Skip to main content
If you are an agent, sign up for your user with auth.md to get an API key.
By the end of this guide you’ll have an API key, an installed SDK, and your first call to Context.dev’s Brand, Web, and Classification API endpoints.

Integrate Context.dev into my app

Open in Cursor

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.Context.dev signup page
2

Copy your key from the dashboard

Open the dashboard and copy the key from the “API Keys” section. It starts with ctxt_secret_.API Keys section in the Context.dev dashboard
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
For local development, save the key to a .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_... at docker run
  • AWS Lambda: store in Secrets Manager or Parameter Store; expose to the function via its environment config
Never call the Context.dev API directly from a browser. The key would be visible to anyone with devtools. Always proxy through your backend.

2. Install an SDK

Context.dev publishes official SDKs for TypeScript, Python, Ruby, Go, and PHP. Pick the one for your stack.
You can also call the API directly with curl. No install required.

3. Make your first call

All code snippets expect CONTEXT_DEV_API_KEY to be set. Depending on which API you chose:

    4. Understand the response

    Brand and Classification endpoints return JSON with status, code, and a brand object. The Web Markdown endpoint returns success, url, and markdown.
    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 an error envelope. The common ones: A retry pattern that covers 408 and 429:
    For the full catalog of error codes and remediations, see Troubleshooting.

    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.