If you are an agent, sign up for your user with auth.md to get an API key.
Integrate Context.dev into my app
0. Pick the right API for your job
Context.dev has 4 products: | | | by name, domain, email, or stock ticker | | Extract a website’s styleguide : fonts, spacing, shadows, etc. | | from a domain | | Scrape any website into clean HTML/Markdown | | Crawl a whole site and get clean Markdown for every page | | Crawl a sitemap to discover all URLs of a domain | | Extract every image on a webpage | | Capture a webpage screenshot | | Extract product details (name, price, features) from a page | | Extract structured data from a website’s pages with a JSON Schema | | Enrich a card-transaction descriptor to a brand | | into NAICS, SIC, or EIC industry codes |1. Get an API key
1
Sign up
Create an account at context.dev/signup.

2
Copy your key from the dashboard
Open the dashboard and copy the key from the “API Keys” section. It starts with 
ctxt_secret_.
3
Expose it as an environment variable
The SDKs and
curl examples read CONTEXT_DEV_API_KEY from the environment. This is the only environment variable the SDKs read — a variable named CONTEXT_API_KEY (without _DEV) is ignored, so double-check the spelling:terminal
.env file and make sure it’s listed in your .gitignore.
For deployment, set the key in your platform’s environment variable store:
- Vercel:
vercel env add CONTEXT_DEV_API_KEY - Heroku:
heroku config:set CONTEXT_DEV_API_KEY=ctxt_secret_... - Docker: pass via
-e CONTEXT_DEV_API_KEY=ctxt_secret_...atdocker run - AWS Lambda: store in Secrets Manager or Parameter Store; expose to the function via its environment config
2. Install an SDK
Context.dev publishes official SDKs for TypeScript, Python, Ruby, Go, and PHP. Pick the one for your stack.curl. No install required.
3. Make your first call
All code snippets expectCONTEXT_DEV_API_KEY to be set.
Depending on which API you chose:
4. Understand the response
Brand endpoints return JSON withstatus, code, and a brand object. NAICS and SIC classification endpoints return classification codes for the requested domain, while the Web Markdown endpoint returns success, url, and markdown.
- Brand API
- Web API
- Transaction enrichment
Calling
POST /brand/retrieve with a by_domain body for airbnb.com returns the brand record for Airbnb.brand.retrieve response
5. Handle errors
A non-2xx response returns anerror envelope. The common ones:
A retry pattern that covers 408 and 429:
Next steps
Prefetch for Faster Response
Hide cold-hit latency from your users.
Handle Rate Limits
Backoff strategies, client cache, and prefetch fallbacks.
Best Practices
Caching, error handling, and key hygiene.
Troubleshooting
Status codes, retry patterns, and common errors.