Placing an order with the API

A full worked example of placing a People Scraper order through the API, from the curl request to downloading the CSV.

4 min read

This is the full walkthrough for placing a People Scraper order through the API, from building the request to downloading the finished CSV. You'll see a working curl example, what each field means, how to avoid duplicate orders with an Idempotency-Key, and how to check status once it's submitted.

Before you start

You'll need three things:

  • An API key. Create one on the API Key page. If you haven't yet, follow Getting your API key first and test it with GET /me.
  • Enough credits. API orders spend the same balance as the dashboard. At the time of writing, the People Scraper costs 1 credit per lead, with a minimum order of 1,000 leads.
  • An Apollo search URL. Build your search in Apollo with whatever filters you need, then copy the full URL from your browser's address bar. Every filter lives in that link.

For this example, say you've searched for Heads of Marketing and Marketing Directors at software companies with 51 to 200 employees in the United Kingdom, and Apollo shows around 4,000 results.

The request

People orders go to POST /apollo-people-scraper on the base URL https://api.apolloscrapers.com/api/v1. Here's the full call:

curl -X POST https://api.apolloscrapers.com/api/v1/apollo-people-scraper \
  -H "Authorization: Bearer $APOLLO_SCRAPER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: uk-marketing-heads-2026-10-25" \
  -d '{
    "search_url": "https://app.apollo.io/#/people?...your filters...",
    "results_file_name": "UK SaaS Marketing Heads",
    "contact_count": 4000,
    "verify_emails": true,
    "callback_url": "https://example.com/hooks/apollo-scraper"
  }'

Paste your real Apollo URL in place of the placeholder. Keep it inside the JSON string exactly as you copied it.

The fields explained

FieldRequiredWhat it does
search_urlYesThe Apollo people search URL you copied. We use it to pull exactly the people your filters match.
results_file_nameYesThe name for your CSV, 1 to 120 characters. Make it descriptive so you can find it later in Orders.
contact_countYesHow many leads you want, as a positive whole number. Minimums and the 1,000,000 maximum per order apply.
verify_emailsNotrue or false. People Scraper only. Adds email verification (300 extra credits per 1,000 leads at the time of writing) and fills the email_status column.
callback_urlNoAn https URL we'll POST to when the order changes state. See Getting files with webhooks.

The Company and Mobile scrapers take the same body shape at POST /apollo-company-scraper and POST /apollo-mobile-scraper. Just leave out verify_emails, since it only applies to people orders.

Why the Idempotency-Key matters

Networks fail. A request can time out on your side even though it reached us fine, and the natural reaction is to retry. Without protection, that retry could create a second order and spend your credits twice.

The Idempotency-Key header fixes that. Send a unique value for each order you intend to place, and if the same key arrives again, we treat it as the same order rather than a new one. A few practical rules:

  • Generate one key per real order. A UUID works, or something readable like a campaign name plus a date.
  • Reuse the same key when retrying that exact order.
  • Use a new key when you genuinely want a new order, even if the search URL is the same.

Tip: If your script loops over a list of searches, build the key from something stable in each row (like a row ID) rather than a timestamp. That way a crashed-and-restarted script won't double-order.

The response and checking status

A successful request returns JSON describing the new order, including its order ID and status. Save the ID, because every follow-up call uses it. The exact response fields are listed in the API documentation.

New orders start as pending or queued, move to processing, and finish as completed (or cancelled). To check on one, call:

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

You can also list all your orders with GET /orders. Most orders are ready within 24 hours, and often much sooner, so there's no need to poll every few seconds. Checking every few minutes is plenty, and webhooks are even better if you can receive them.

Downloading the file

Once the status is completed, fetch the CSV with:

curl -L https://api.apolloscrapers.com/api/v1/orders/ORDER_ID/download \
  -H "Authorization: Bearer $APOLLO_SCRAPER_API_KEY" \
  -o uk-saas-marketing-heads.csv

The file is a UTF-8 CSV with the standard People columns: first_name, last_name, title, seniority, company, company_domain, email, email_status, linkedin_url, city and country. It's also available in Orders in the dashboard, and you can re-download it for 180 days.

If the search had fewer matches than your contact_count, you'll get everything that's there and the credits for the rest go back to your balance automatically. You can confirm that with GET /me or in Credit History.

Where to go next

Ready to stop polling? Set a callback_url and read Getting files with webhooks. For every endpoint and error code, check the API documentation.

Still stuck?

Our team usually replies the same day.

Contact support
Place an Apollo Export Order With the API (curl Example)