Skip to main content

QuickStart

This example generates Instagram followers without a collection or input rows. It can consume Datablist credits. Replace the sample profile with a profile you want to query.

Authentication​

For most integrations, use a Personal API Key. Datablist handles token renewal for you.

Create a Personal API Key from the API page in your Datablist account, then send it on each authenticated request:

http
X-API-Key: YOUR_PERSONAL_API_KEY

New keys use <userId>-<accountId>-<secret>-2. The user ID in the key omits the auth0| prefix. Access-token responses still return the full user ID. For example, this fictional key shows the format:

text
exampleuser-exampleaccount-EXAMPLE_TOKEN_NOT_VALID-2
Already have an API key?

Older keys use auth0|<userId>:<accountId>:<secret>:1. They remain supported. Keep using your existing key exactly as generated; you do not need to replace or reformat it.

Header names are case-insensitive, so x-api-key also works. Datablist handles access-token exchange and renewal on the next request when less than 30 minutes remain. You do not need to manage tokens yourself.

If renewal is temporarily unavailable, requests can continue with an existing unexpired token. A rejected or deleted key never uses this fallback. Deleting a key prevents future exchanges, but a cached token may remain usable until renewal or expiry, potentially nearly 24 hours. Replace the saved key to rotate it.

Send either X-API-Key or Authorization, never both; supplying both returns 400 AmbiguousCredentials. Keep credentials out of URLs, task data, logs, and public code. You can access only your key's account.

Using an access token instead (optional)​

Skip this step when using x-api-key. If your application needs to manage access tokens itself, exchange your key:

bash
curl --request POST 'https://api.datablist.com/v1/account/token' \
--header 'Content-Type: application/json' \
--data '{"apiKey":"YOUR_PERSONAL_API_KEY"}'

See Get an access token for the request field, response attributes, and error statuses.

The response contains the token and its expiration:

json
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 86400,
"expires_at": 1791622800,
"account_id": "account-id",
"user_id": "user-id",
"plan": "business",
"scope": ["admin"]
}

Send access_token on every authenticated request:

http
Authorization: Bearer ACCESS_TOKEN

In Bearer mode, your application must replace the token after its 24-hour expiration. Send the access token, not the Personal API Key, in Authorization.

Try a request in the documentation​

Open Try it on an endpoint page. Choose Personal API Key, paste your key, and click Connect. You can also choose Access token to use a token you already have. The key is cleared after exchange. Authentication stays in memory while you navigate the documentation; refreshing the page or clicking Disconnect clears it. Connect again after the token expires or a request returns 401.

Fill in your IDs and review the parameters and JSON body, then click Send. The response panel shows the status, body, headers, and request duration. These are real API calls: tasks can consume credits, and writes or deletions change your data.

Closing the panel or clicking Cancel request stops waiting in your browser. It cannot undo work already accepted by the API. Check task status yourself; the documentation does not retry requests or check progress automatically.

Previous calls stay available in the panel so you can find earlier IDs and responses. Disconnect clears your credentials and call history.

1. Discover the source​

Catalog discovery requires no authentication. Use your Personal API Key for task creation and subsequent task operations.

bash
curl 'https://api.datablist.com/v1/sources'
curl 'https://api.datablist.com/v1/sources/instagram-source'

Confirm the source is available, then inspect settingsSchema, outputSchema, and limits.

2. Create a task​

bash
curl --request POST 'https://api.datablist.com/v1/sources/tasks' \
--header 'X-API-Key: YOUR_PERSONAL_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"sourceId": "instagram-source",
"uniqueId": "instagram-followers-example",
"settings": {
"profiles": ["example_profile"],
"scrapingType": "followers",
"limitPerProfile": 100
}
}'

The API returns 202 Accepted. Save the task @id, links.self, and links.results. The requested limit is not a guarantee of an exact result count. Omit maxCredits for no task-specific budget, or use a nonnegative decimal string for a best-effort credit limit.

3. Check task status​

bash
curl 'https://api.datablist.com/v1/sources/tasks/TASK_ID' \
--header 'X-API-Key: YOUR_PERSONAL_API_KEY'

Poll every few seconds until status is completed, failed, or stopped. The response shows how many objects have been generated, the credits used, and an error if the task failed.

4. Retrieve every result page​

bash
curl 'https://api.datablist.com/v1/sources/tasks/TASK_ID/results?limit=500' \
--header 'X-API-Key: YOUR_PERSONAL_API_KEY'

Results contain flat JSON objects. If nextCursor is not null, request the next page, passing the cursor unchanged:

bash
curl --get 'https://api.datablist.com/v1/sources/tasks/TASK_ID/results' \
--header 'X-API-Key: YOUR_PERSONAL_API_KEY' \
--data-urlencode 'limit=500' \
--data-urlencode 'cursor=NEXT_CURSOR'

Read results from failed or stopped tasks too; some work may have finished. Requesting results while a task is still active returns 409 ResultsNotReady. See Get tasks results.

Safe retries​

If a creation response is lost, look for your uniqueId in task history before sending another POST. The task may already have run.

An active duplicate returns 409. Once the task finishes or becomes overdue, the same uniqueId can start a new task and consume credits again. Check both source and enrichment histories if you use both APIs. See task lifecycle for cancellation, retention, and shared limits.

Last updated on