Jobs

Run an endpoint for up to 1,000 inputs

Run one GET endpoint for up to 1,000 inputs in the background. dryRun: true returns the quote for 0 credits; maxCredits approves it. Failed inputs are…

POST/v1/jobs
x-api-keystringheader

API key (`sfk_...`)

Parameters
1
idempotency-keystringheader

A key you choose for this job, such as a UUID. A retry with the same key and body returns the job the first request made, with `Idempotent-Replayed: true`, and holds nothing more. The key is kept as long as the job is (7 days); use a new key for each job.

pattern: ^[!-~]{1,255}$

Request body

requiredapplication/json
Response fields
34

Endpoint-specific response payload.

datadryRun
boolean

The price of this job, worked out before anything runs.

dataquoteendpoint
string

The endpoint every input runs.

dataquoteitemCount
integer

How many inputs.

≥ 0

dataquotecredits
integer

The most this job can cost: every input at its endpoint's price. A run holds this much and charges only what its inputs cost.

≥ 0

The cheapest and dearest input's price.

dataquotecreditsPerItemmin
integer

≥ 0

dataquotecreditsPerItemmax
integer

≥ 0

The job, just queued; null on a dry run.

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.

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" \
  -H "x-api-key: $SOCIALFETCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"endpoint":"string","items":[{}],"dryRun":false,"maxCredits":0,"webhookEndpointId":"string"}' \
  -X POST

Responses

A dry run: the quote, for 0 credits. Nothing was held.