Help · API and AI assistants

API keys and your first API request

Create an API key, send it in the Authorization header, submit a search, poll for the results and read them page by page.

Everything you can do in the dashboard's search tools is also available over a REST API at the same prices. This article covers keys and the basic flow. The full list of routes and fields is in the API reference at api.dataatscale.com/docs.

Create a key

Only admins can create keys. Open Settings › Developers, press New key, and give it a name that says what it is for, because the name is the only label you see later. The full key is shown once, so copy it then. You can never see it again.

A key starts with das_live_, belongs to your organisation, and never expires. When you create it you can pick one workspace, and the key then works only in that workspace. Revoke a key in Settings › Developers and it stops working immediately. When the person who made a key changes or resets their password, the keys they made are revoked too, so make new ones then.

A key can run searches, read tasks and results, and check your balance, tokens, limits, usage and credit history. A key limited to a workspace cannot read the credit history. Changing your plan, buying credits, opening the payment portal and inviting people stay with an admin signed in to the dashboard.

Send the key

Each request carries one header:

Authorization: Bearer das_live_your_key

Requests also need to accept gzip, so send Accept-Encoding: gzip. A request without it is refused with gzip_required.

Each tool has its own route, and the same routes are listed in the API reference.

ToolRoute
Find similarPOST /v1/youtube/lookalike, /v1/tiktok/lookalike, /v1/instagram/lookalike
Search by topicPOST /v1/youtube/topic-search, /v1/tiktok/topic-search, /v1/instagram/topic-search
Look up creatorsPOST /v1/youtube/creator-lookup, /v1/tiktok/creator-lookup, /v1/instagram/creator-lookup
Creator Brand ScanPOST /v1/youtube/brand-scan, /v1/tiktok/brand-scan, /v1/instagram/brand-scan
YouTube channel emailsPOST /v1/youtube/email-extraction
TikTok ShopPOST /v1/tiktok/shop/creator-search and the other four under /v1/tiktok/shop/

Name the task with an optional label of 1 to 120 characters. Without one it gets a generated name. Send workspace_id to run it in a workspace, and leave it out to use your default workspace.

The response gives you a task_id and credits_locked, which is the most the task can cost, and tokens_locked, the tokens it holds. Send max_credits to set the most you are willing to pay: if the task would cost more, nothing is started or charged and the request is refused. A malformed request is refused with a 422 that lists the fields that failed, and a field name the API does not know is refused and not ignored.

To see the price before you commit, send the same body to the tool's route plus /estimate. Estimates, input checks and match counts are free.

Get the results

Searches run in the background and take a few minutes, up to about 40 minutes. A task is queued, then running, then ends as completed, failed or cancelled.

  1. Poll GET /v1/{platform}/{feature}/{task_id} until status is completed, failed or cancelled. The call returns at once with the current state, so you can call it as often as you like.
  2. Read GET /v1/{platform}/{feature}/{task_id}/results.
  3. Each page carries next_cursor. Send it back as ?cursor= for the next page and stop when it comes back empty. Do not build or parse a cursor yourself. limit sets the page size.

Instead of polling you can pass a webhook_url at submit, which the next article covers.

Cancel a task

POST /v1/{platform}/{feature}/{task_id}/cancel stops a task that has not ended. Results already produced are charged at the normal rate, and the rest of the held credits and tokens come back.

Size limits for one task

TaskMost it takes
Find similar, Search by topic1,000 results
TikTok Shop affiliate search20,000 creators
Look up channels, creators or accounts5,000 creators
Look up GMV10,000 creators
Get channel emails1,000 channels
Creator Brand Scan1 creator

A request body can be at most 256 KB, and a larger one is refused with a 413. Saving creators to a list and bulk list changes take larger bodies.

Prices, balance and limits

  • GET /v1/pricing returns the live credit price of each tool and what a credit costs you.
  • GET /v1/billing/balance returns your balance.
  • GET /v1/billing/tokens returns the tokens you hold and when each batch ends.
  • GET /v1/billing/limits shows each daily limit and how much is used.
  • GET /v1/billing/ledger lists all credit movements.

Errors

Each error has a code you can branch on and a detail sentence for a person. A 422 adds fields, and a 402 adds credits_needed and your balance, or cap_remaining when your monthly spending cap stopped it. A 429 for too many requests adds how many seconds until more open up.

CodeMeaning
unauthorizedYour key is missing, invalid or revoked.
insufficient_creditsYour balance cannot cover what the request can cost.
spending_cap_reachedThe request would take this month past your spending cap.
forbiddenYour role or workspace access does not allow it.
email_not_confirmedThe account behind the key has not confirmed its email.
daily_limit_reachedA daily limit of your plan is used up.
rate_limitedToo many requests to one route in 10 minutes.
validation_errorA field is missing or not in the expected format.

New codes may appear, so handle an unknown one by its HTTP status.

Still stuck

Email [email protected] with the job name or ID and what you expected, and we will help.

All help articles