Amazon Login Actor avatar

Amazon Login Actor

Pricing

$0.15 / actor start

Go to Apify Store
Amazon Login Actor

Amazon Login Actor

Performs Amazon browser login with fingerprint and returns fresh cookies. Called by the reviews scraper when cookies expire.

Pricing

$0.15 / actor start

Rating

0.0

(0)

Developer

agi

agi

Maintained by Community

Actor stats

0

Bookmarked

11

Total users

6

Monthly active users

23 days ago

Last modified

Categories

Share

An Apify Actor that performs Amazon browser login with a simulated Windows Chrome fingerprint and returns fresh session cookies. Called by the ../apify/ when scraped cookies expire.

How it works

  1. Generates a Windows Chrome fingerprint via browserforge (part of the Crawlee ecosystem) — User-Agent, navigator properties, screen dimensions all consistent with a real Windows desktop Chrome session.
  2. Launches headless Chromium (Playwright, managed by Crawlee) with:
    • --password-store=basic, --disable-features=PasswordManager,WebAuthnUI,WebAuthentication to suppress password-save dialogs and Windows security prompts
    • WebAuthn / Credentials API blocked via add_init_script
    • Persistent context (launch_persistent_context) for static resource caching
  3. Navigates the Amazon login flow (email → password → 2FA → challenges), same logic as gologin-worker.
  4. Extracts all cookies from the browser context and outputs them.

Input

FieldTypeRequiredDescription
accountstringyesAmazon account email
passwordstringyesAmazon account password
countrystringyesMarketplace country code (e.g. US, GB, DE)
faTokenstringnoTOTP shared secret for 2FA. Leave empty if the account has no 2FA.

Output

Saved to the run's key-value store under key OUTPUT:

{
"status": "success",
"country": "US",
"domain": "www.amazon.com",
"cookie_count": 42,
"cookies": [
{
"name": "session-id",
"value": "...",
"domain": ".amazon.com",
"path": "/",
"expires": 1234567890.0,
"httpOnly": true,
"secure": true,
"sameSite": "None"
}
]
}

Possible status values: success, suspended, failed.

On failure, error and message fields are included (plus logs for debugging on dev accounts).

Logging

Only developer accounts see full stdout logs (config.is_dev_account() — based on DEV_USER_IDS, CRAWLER_VERBOSE_LOG, dev build tag, or local run without ACTOR_RUN_ID). All other runs output only public milestones. Sensitive fields (password, 2FA token, cookies) are redacted in logs regardless of account type.

Integration with the Reviews Scraper

The scraper calls this actor via Actor.call() when it detects an expired session (SessionExpiredError):

  1. Scraper acquires a session from the server → gets cookies + credentials
  2. Scraper scrapes with those cookies
  3. If SessionExpiredError → scraper calls this login actor with the credentials
  4. Login actor returns fresh cookies → scraper retries scraping once
  5. If the retry still fails → no further retry, the ASIN is marked as failed

To enable, set the LOGIN_ACTOR_ID environment variable on the scraper actor (to this login actor's ID). If unset, the scraper falls back to the original server-based cookie retry loop.

Development

# Install dependencies
pip install -r requirements.txt
playwright install chromium
# Run locally
python -m src