Async tasks
Task result
Reads a search you queued with a pingback URL: its status while it waits or runs, then its answer.
GET
https://api.scraperdata.com/v1/tasks/{id}Credits
Reading a task is free. Answers are kept for 7 days.
Call it when your pingback arrives, with the id it carries. While the search waits or runs the answer is 202 with its status; once it ends it is 200 with the result or the error.
Path parameters
| Field | Type | Description |
|---|---|---|
id | string | requiredThe task id from the 202 answer of a queued search.Example: 5b0f6c2e9a8d... |
Status codes
202: the search is queued or running.200: the search is done (seeresult) or failed (seeerror).404withtask_not_found: no task with this id in your account, or it is older than 7 days.
Response
| Field | Type | Description |
|---|---|---|
id | string | The task id. |
status | string | queued or running while it waits, then done or failed. |
created_at, started_at, finished_at | string | When it was sent, started and ended, in ISO 8601. |
credits_charged | integer | Credits it cost: one per page that came back, nothing when it failed. |
pingback | object | The call to your URL. |
url | string | Your pingback URL. |
status | string | waiting for the search, then pending, sent or failed. |
attempts | integer | How many times we called it. |
last_status_code | integer | The status your server answered, 0 when it did not answer. |
result | object | The answer, the same JSON a live search returns. Only when done. |
error | object | The reason, with a code and a message. Only when failed. |