Integrate Context.dev into my app
0. Pick the right API for your job
Context.dev has 4 products:| API | Use-case |
|---|---|
| Brand APIs | Look up a brand by name, domain, email, stock ticker, or ISIN |
| Extract a website’s styleguide: fonts, spacing, shadows, etc. | |
| Logo Link CDN | Get embeddable logo images from a domain |
| Web APIs | Scrape any websiteinto clean HTML/Markdown |
| Crawl a whole siteand get clean Markdown for every page | |
| Crawl a sitemapto discover all URLs of a domain | |
| Extract every imageon a webpage | |
| Capture a webpage screenshot | |
| Extract product details(name, price, features) from a page | |
| Extract structured datafrom a website’s pages with a JSON Schema | |
| Classification APIs | Enrich a card-transaction descriptorto a brand |
| Classify a brand into NAICS, SIC, or EIC industry codes |
1. Get an API key
Sign up
Create an account at context.dev/signup.

Copy your key from the dashboard
Open the dashboard and copy the key from the “API Keys” section. It starts with 
ctxt_secret_.
.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, and Go. 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:
- Brand API
- Web API
- Classification APIs
Retrieving a brand requires a brand identifier (name, domain, email, stock ticker, or ISIN code) and gives you its logo, name, slogan, description, address, social media handles, and more.Read the full guide10 credits per successful call
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
/brand/retrieve with domain=airbnb.com returns the brand record for Airbnb.brand.retrieve response
| Field | Type | Description |
|---|---|---|
brand.title | string | Company name. |
brand.domain | string | Canonical domain. |
brand.description | string | Brief description of the brand. |
brand.slogan | string | The brand’s slogan. |
brand.colors[] | array | Brand colors. Each has hex and name. |
brand.logos[] | array | Logos associated with the brand. Each has url, mode (light, dark, has_opaque_background), type (icon, logo), colors[], and resolution. |
brand.backdrops[] | array | Backdrop images for the brand. Each has url, colors[], and resolution. |
brand.address | object | street, city, state_province, state_code, country, country_code, postal_code. |
brand.socials[] | array | Social profile URLs. Each has type (x, facebook, linkedin, instagram, …) and url. |
brand.stock | object | ticker and exchange. null for private companies. |
brand.phone | string | Company phone number. |
brand.is_nsfw | boolean | Indicates whether the brand content is not safe for work (NSFW). |
brand.industries.eic[] | array | Easy Industry Classification industry and subindustry pairs. |
brand.links | object | Important website links (careers, privacy, terms, contact, blog, pricing); fields may be null when not found. |
brand.primary_language | string | Primary language of the brand’s website content, or null when not detected. |
5. Handle errors
A non-2xx response returns anerror envelope. The common ones:
| Status | Meaning | What to do |
|---|---|---|
| 401 | API key missing, invalid, or deleted | Re-check the env var and the dashboard. |
| 408 | Cold-hit timeout (rare; first crawl exceeded the deadline) | Retry once; the second hit is warm. Better: prefetch. |
| 422 | Disposable or free-email address on retrieve-by-email | Skip the call for personal addresses. |
| 429 | Rate limit | Wait per the Retry-After header; see Handle Rate Limits. |
| 500 | Transient server error | Retry once with backoff; if it persists, contact support. |
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.