Integrate Context.dev's Extract API in your app
Prerequisites
-
A Context.dev API key. Sign up at context.dev/signup, copy the key from the dashboard (prefix
ctxt_secret_), and export it: -
An SDK (optional). Install for your language, or skip the install and call directly with
curl:
Extract data
You describe the result you want as one JSON Schema. Property names become the keys of the response’sdata object, and each property’s description tells the model what to look for:
Request parameters
Use your schema library
Becauseschema is standard JSON Schema, you don’t have to write it by hand: generate it from the schema library you already use, and validate response.data on the way out with the same model. Nested structures like arrays of objects come for free:
Understand the response
A successful call returns the starting URL, the URLs the crawler actually used, your data in the shape of your schema, and crawl statistics:sample response
Error responses include an
error_code. Common ones: INPUT_VALIDATION_ERROR (bad URL or schema) and WEBSITE_ACCESS_ERROR on 400, UNAUTHORIZED on 401 (missing or invalid API key), REQUEST_TIMEOUT on 408, RATE_LIMITED on 429, and INTERNAL_ERROR on 500.
Blocked and parked pages
Before pages reach the extraction model, the crawler classifies each fetched page and excludes CAPTCHA walls, bot interstitials, 403/404 pages, login shells, and parked-domain landers. Excluded pages don’t contribute todata and are counted in metadata.numBlocked.
- If the starting URL is blocked, the crawler retries it once with cache bypass and anti-blocking enabled before giving up.
- If every crawled page ends up blocked, the request returns
400 WEBSITE_ACCESS_ERRORand is not billed. Treat this the same as any otherWEBSITE_ACCESS_ERROR(see Troubleshooting). - If some pages come back clean, extraction runs against those and
numBlockedrecords how many were dropped.
Schema type aliases
schema follows JSON Schema, so type values should be "string", "number", "integer", "boolean", "array", "object", or "null". Common non-canonical names hand-written by callers are accepted and normalized before validation — for example "List" becomes "array", "Text", "URL", and "Email" become "string", "Int" becomes "integer", and "Bool" becomes "boolean". Prefer the canonical keywords in new code; the aliases exist to keep hand-written schemas working.
Use cases
- Lead enrichment: extract
founded_year,employee_count,headquarters_cityetc. from a company’s site to enrich CRM records. - Hiring signal tracking: extract an array of open roles (title, location, team) starting from a careers page for sourcing pipelines or competitor monitoring.
- Compliance snapshots: extract a structured summary of privacy policy or terms clauses on a schedule with
factCheck: true, then diff against the last run. - Investor relations data: extract revenue, ARR, headcount, or funding figures as typed numbers; PDF parsing picks up IR decks and annual reports automatically.
Next steps
Scrape Websites
Get clean Markdown, HTML, or sitemap URLs from any page.
Extract Products
Typed product data: SKU, price, images, from any storefront.
Best Practices
Caching, error handling, and key hygiene.
Troubleshooting
Status codes, retry patterns, and common errors.