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, stock ticker, or ISIN | | 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. The SDKs read CONTEXT_DEV_API_KEY first and fall back to CONTEXT_API_KEY if it isn’t set, so exporting CONTEXT_DEV_API_KEY alone is enough: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 and Classification endpoints return JSON withstatus, code, and a brand object. The Web Markdown endpoint returns success, url, and markdown.
- Brand API
- Web API
- Classification APIs
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.