Getting your API key

Create your Apollo Scraper API key, store it safely, regenerate it if lost, and test it with a quick GET /me call.

4 min read

If you want to place orders from your own scripts, CRM or automation tool, you'll need an API key. This guide shows you how to create one, where to keep it so it doesn't leak, what to do if you lose it, and how to check it works with a single curl command.

What the API key does

Your API key is how our servers know a request is coming from you. Every call to the Apollo Scraper API sends the key in a header, and we use it to find your account, check your credit balance and attach any new orders to your dashboard. Orders placed through the API show up in Orders just like the ones you submit by hand, and they spend credits from the same balance.

That last part matters. Anyone who has your key can place orders and spend your credits. Treat it like a password, not like a username.

Creating your key

  1. Log in to your dashboard.
  2. Open the API Key page from the sidebar.
  3. Click the button to create a key.
  4. Copy the key straight away and paste it somewhere safe (more on that below).

Keys start with as_live_ followed by a long string of characters. If you ever find a string like that in a file, a chat log or a screenshot, you'll know exactly what it is.

Tip: The full key is only shown once, right after you create it. After that the dashboard won't display it again. If you close the page before copying it, don't worry, just regenerate a new one.

Storing it safely

The most common way keys leak is boring: someone pastes them directly into a script and then commits that script to a shared repository. Here's how to avoid that.

Use an environment variable

Keep the key out of your code and read it from the environment instead. On macOS or Linux you can set it for your current terminal session like this:

export APOLLO_SCRAPER_API_KEY="as_live_your_key_here"

On Windows PowerShell it looks like this:

$env:APOLLO_SCRAPER_API_KEY = "as_live_your_key_here"

Your code then reads APOLLO_SCRAPER_API_KEY at runtime. In Python that's os.environ["APOLLO_SCRAPER_API_KEY"], and in Node it's process.env.APOLLO_SCRAPER_API_KEY.

Other good habits

  • If you use a .env file locally, add it to .gitignore so it never gets committed.
  • In hosted tools (serverless functions, CI pipelines, no-code automation platforms), use their built-in secrets or credentials store rather than a plain text field.
  • Don't share the key in email, Slack or support tickets. We never need it to help you.
  • Only give the key to the systems that actually place orders. Your reporting spreadsheet probably doesn't need it.

Testing your key with GET /me

The quickest way to confirm everything is set up is to call the /me endpoint. It returns your account details and current credit balance, and it doesn't place an order or spend anything. It's the API version of "hello, is this thing on?"

All requests go to the base URL https://api.apolloscrapers.com/api/v1 with your key in an Authorization header:

curl https://api.apolloscrapers.com/api/v1/me \
  -H "Authorization: Bearer $APOLLO_SCRAPER_API_KEY"

If the key is valid, you'll get a JSON response with your account information and balance. Check that the balance matches what you see in the dashboard. If it does, you're connected to the right account.

If the test fails

  • Unauthorized error: the key is missing, mistyped or has been regenerated. Make sure the header reads Bearer, then a space, then the full key with no extra quotes or line breaks.
  • Empty variable: if you set the environment variable in one terminal window and ran curl in another, the second window won't know about it. Run echo $APOLLO_SCRAPER_API_KEY to check.
  • Wrong URL: double-check the /api/v1 part of the base URL. It's easy to drop.

While you're testing, you can also call GET /pricing to see the current credit cost for each scraper. It's handy if your script needs to estimate costs before it submits anything.

Regenerating a lost or exposed key

If you lose your key, or think someone else might have it, go back to the API Key page and regenerate it. A new key is created and shown to you once, and the old key stops working immediately.

That second part is deliberate. It means a leaked key becomes useless the moment you replace it. It also means any script, server or automation still using the old key will start getting errors, so update them all with the new one. A quick checklist:

  1. Regenerate the key and copy it.
  2. Update the environment variable or secrets store everywhere it's used.
  3. Restart any long-running process that read the old value at startup.
  4. Run the GET /me test again to confirm.
  5. Check Credit History for any orders you don't recognise.

If you spot spending you didn't make, email support@apolloscrapers.com and we'll look into it with you.

Next steps

Once /me returns your balance, you're ready to place a real order. Head to Placing an order with the API for a full worked example, or read Getting files with webhooks if you'd rather be notified than poll for status. The complete endpoint reference lives in the API documentation.

Still stuck?

Our team usually replies the same day.

Contact support