Trigger extraction schema discovery for an already-scraped job
const url = 'https://api.justcrawl.io/api/v1/extraction/discover';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"jobId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","pageType":"product","attributes":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.justcrawl.io/api/v1/extraction/discover \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "jobId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pageType": "product", "attributes": [ "example" ] }'Re-drives extraction against a job’s cached HTML — the provider is never re-hit. When no extraction schema covers the requested attributes, this also triggers LLM XPath discovery for the job’s domain and page type.
Discovery is shared across orgs and costs LLM budget, so it runs at most once per domain/page-type: a schema that already covers every requested attribute is reused as-is, and a schema missing some of them is topped up rather than rediscovered from scratch.
Returns 202 — the work happens asynchronously. Poll
GET /api/v1/extraction/schemas/{domain}/{pageType} for the schema and
GET /api/v1/extraction/results/{jobId} for this job’s extracted values.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
A completed job owned by the caller’s org, whose body blob is still retained.
Attribute names to ensure the schema covers. Omit for the page
type’s full default attribute set. Names must match
^[a-z][a-z0-9_]*$.
Responses
Section titled “Responses”Discovery request accepted and queued.
object
The canonical (www-stripped) domain the schema is keyed on.
Examplegenerated
{ "domain": "example", "pageType": "example"}Missing jobId, a pageType outside the enum, or an attributes list that is too long or contains a malformed name.
Missing or invalid authentication token
object
Example
{ "error": "Missing or invalid authentication token"}Insufficient permissions for this operation
object
Example
{ "error": "No organization. Complete onboarding first."}No such job in the caller’s org.
The job is still pending, running or waiting_retry, so it has not produced a body yet. Retryable — wait for the job to finish and call again.
The job’s cached body is gone (never stored, or past its retention window), so there is nothing to re-extract.
Unexpected server error. Logs and PostHog $exception capture
object
Example
{ "error": "Something went wrong"}