Job result API
Poll a job that answered 202.
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
- 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).
1curl "https://api.socialscrape.dev/v1/jobs/job_0123456789abcdef01234567" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY"1import os2import requests34res = requests.get(5 "https://api.socialscrape.dev/v1/jobs/job_0123456789abcdef01234567",6 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},7)8body = res.json()910if body["ok"]:11 print(body["data"])12else:13 print(body["error"]["code"], body["error"]["message"])1const res = await fetch("https://api.socialscrape.dev/v1/jobs/job_0123456789abcdef01234567", {2 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },3});4const body = await res.json();56if (body.ok) {7 console.log(body.data);8} else {9 console.error(body.error.code, body.error.message);10}1{2 "nodes": [3 {4 "name": "SocialScrape Job result",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/jobs/{job_id}",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "job_id",19 "value": "job_0123456789abcdef01234567"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Example response#
This is a sample with illustrative values. Status 202.
200 OKSample response
1{2 "ok": true,3 "credits_charged": 0,4 "credits_remaining": 5000,5 "cached": false,6 "cached_at": null,7 "request_id": "req_880140c567a69012f7f36cb1",8 "data": {9 "object": "job",10 "job_id": "job_0123456789abcdef01234567",11 "status": "running",12 "poll_url": "https://api.socialscrape.dev/v1/jobs/job_0123456789abcdef01234567"13 },14 "cursor": null,15 "has_more": null16}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.