Jobs

Get a job and its results

Get a batch job's status and progress, and its results page by page. Results are kept for 7 days.

GET/v1/jobs/{id}
x-api-keystringheader

API key (`sfk_...`)

Parameters
3
idstringrequiredpath

The job's id.

min 1 chars · max 100 chars

cursorstringoptionalquery

`data.page.nextCursor` from the previous page.

pattern: ^\d{1,4}$

limitintegeroptionalquery

Inputs per page, 1 to 50 (20 by default). A page of large results can end sooner; follow `nextCursor`.

≥ 1 · ≤ 50

Response fields
39

Endpoint-specific response payload.

A batch job.

datajobid
string

The job's id.

datajobendpoint
string

The endpoint every input runs.

datajobstatus
string

`queued` until it starts, `running`, then `completed`. `expired` when it reached its 24-hour limit first: inputs that hadn't run failed, uncharged.

one of: queued, running, completed, expired

datajobitemCount
integer

≥ 0

How far the job has got.

datajobprogressdone
integer

Inputs that have run.

≥ 0

datajobprogresssucceeded
integer

≥ 0

datajobprogressfailed
integer

≥ 0

datajobprogresspending
integer

≥ 0

What the job holds and costs.

datajobcreditsquoted
integer

The quote, held while the job runs.

≥ 0

datajobcreditscharged
integernullable

What the job cost; null until it has ended.

≥ 0

datajobcreditsrefunded
integernullable

The part of the quote given back: failed inputs, and inputs that cost less than their price. Null until the job has ended.

≥ 0

datajobwebhookEndpointId
stringnullable
datajobcreatedAt
string

ISO 8601.

datajobstartedAt
stringnullable

ISO 8601; null while queued.

datajobcompletedAt
stringnullable

ISO 8601; null until it has ended.

datajobexpiresAt
string

ISO 8601: when the job and its results are deleted, 7 days after it was created.

One page of the inputs, in order.

dataitems[]index
integer

The input's position in `items`, from 0.

≥ 0

dataitems[]params
object

The input, as the endpoint read it.

dataitems[]status
string

`pending` until it runs, then `ok` or `failed`.

one of: pending, ok, failed

dataitems[]creditsCharged
integer

What this input cost. A failed input costs nothing unless its endpoint charges that failure when called on its own.

≥ 0

dataitems[]ms
integernullable

How long its call took, in milliseconds.

≥ 0

Why it failed: the endpoint's own error. Null otherwise.

dataitems[]errorcode
string
dataitems[]errormessage
string
dataitems[]data
nullableoptional

The endpoint's `data`, exactly as the endpoint returns it. Null while pending or when it failed.

Pagination state for the current page.

datapagehasMore
boolean

Whether another page is available.

datapagenextCursor
stringnullable

Cursor to pass in the next request when more pages exist; null on the last page.

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

metastale
booleanoptional

Present, and `true`, only when the source couldn't be reached and this is the last good answer for the same request instead, up to 24 hours old. Absent on every live answer.

one of: true

metafetchedAt
stringoptional

When a stale answer (`stale: true`) was originally fetched (ISO 8601, UTC). Absent on every live answer.

Code example

curl "https://api.socialfetch.dev/v1/jobs/abc123" \
  -H "x-api-key: $SOCIALFETCH_API_KEY"

Responses

The job's status, progress and credits, and one page of its inputs with their results.