Job result
Beta GET /v1/jobs/{job_id}
GET /v1/jobs/{job_id}
Poll a job that answered 202. Free while pending; when done this returns the job's final envelope (and charges then, once).
- Cost: Free
- Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
- Cache: Not cached.
Parameters#
| Name | Type | Required | Description | In |
|---|---|---|---|---|
job_id | string | yes | Job id from the 202 answer. | path |
Example request#
Set your key in the environment first (see Authentication).
curl
curl "https://api.socialscrape.io/v1/jobs/job_0123456789abcdef01234567" \
-H "x-api-key: $SOCIALSCRAPE_API_KEY"Python
import os
import requests
res = requests.get(
"https://api.socialscrape.io/v1/jobs/job_0123456789abcdef01234567",
headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
)
body = res.json()
if body["ok"]:
print(body["data"])
else:
print(body["error"]["code"], body["error"]["message"])TypeScript
const res = await fetch("https://api.socialscrape.io/v1/jobs/job_0123456789abcdef01234567", {
headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();
if (body.ok) {
console.log(body.data);
} else {
console.error(body.error.code, body.error.message);
}n8n
{
"nodes": [
{
"name": "SocialScrape Job result",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
0,
0
],
"parameters": {
"method": "GET",
"url": "https://api.socialscrape.io/v1/jobs/{job_id}",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "job_id",
"value": "job_0123456789abcdef01234567"
}
]
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-api-key",
"value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
}
]
}
}
}
],
"connections": {}
}Example response#
This is a sample with illustrative values. Status 202.
{
"ok": true,
"credits_charged": 0,
"credits_remaining": 5000,
"cached": false,
"cached_at": null,
"request_id": "req_880140c567a69012f7f36cb1",
"data": {
"object": "job",
"job_id": "job_0123456789abcdef01234567",
"status": "running",
"poll_url": "https://api.socialscrape.io/v1/jobs/job_0123456789abcdef01234567"
},
"cursor": null,
"has_more": null
}Response#
A JobAccepted object in data.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
Every request can also fail with the account and platform errors listed on the Errors page.