1. Prefetch as soon as you know the domain or email
Cold Brand lookups can require a website crawl and take materially longer than warm-cache responses. Prefetching moves that work ahead of the user-facing request. It costs 0 API credits, is available to paid subscribers, and still uses the ordinary API rate limit. See Prefetch for Faster Response for the canonical pattern.2. Cache API responses
If you need brand or classification API outputs frequently, it’s a good idea to cache them in your DB or in the browser’s localStorage. This saves your rate limit quota and API credits usage. Brand records (logos, descriptions, addresses, classifications, etc.) change very infrequently. Context.dev itself only updates a brand in cache every 3 months. Some recommended TTLs:3. Set timeoutMS for cold hits
Warm-cache responses are generally faster. A domain Context.dev has never seen may need a live crawl, bounded by the five-minute platform timeout. If your client timeout is set to something tight like 5 seconds, you’ll cut off the exact requests that needed the most patience.
So on any path that can tolerate the wait, set a generous timeout. The timeoutMS parameter lets you say it explicitly:
timeoutMS tops out at 300,000ms (5 minutes); past that the server gives up and returns a 408. See Troubleshooting for how to handle a 408 when it does happen.
4. Run bulk jobs in the background
Some calls are inherently slow. A full-site crawl (/web/crawl) or a storefront product sweep (/brand/ai/products) walks many pages, and on a large site that can run long.
Don’t block a user’s request on it. Kick the work off, return immediately, and write the results back when they land.
webhookUrl when the batch settles. Batch management calls use a separate rate-limit bucket; processed work is still charged through the batch credit settlement.
5. Retry transient failures with backoff
Three error classes are worth retrying:429 (rate limit), 408 (cold-hit timeout), and 500 (transient server error). Everything else (a 401, a 422) is a bug in the request, and retrying it just wastes calls.
The retry contract (honor the Retry-After header on 429s, otherwise doubling delay, capped attempts) and copy-paste implementations in every SDK live on the Rate limits page. Use that pattern rather than rolling your own.
6. Skip free and disposable emails before you look them up
A brand-by-email lookup againstgmail.com, yahoo.com, outlook.com, and the 10,000+ disposable services out there will never resolve to a company: there’s no brand behind a personal inbox. POST /brand/retrieve with type: "by_email" returns a 422 for these. You can save the round trip by filtering the obvious ones up front:
POST /utility/prefetch detects 10,000+ free and disposable providers when you pass identifier.email, so calling it skips the manual guard entirely. Read how to prefetch.
7. Set up fallbacks for missing datapoints
A200 doesn’t promise a complete record. A private company has no stock ticker, a brand-new domain may have no logo on file yet, and any optional field can come back null or empty. Fall back to a default value instead of branching your whole layout around what’s present:
8. Show a real loading state on cold paths
Cold brand calls and full-site crawls take seconds, not milliseconds, long enough that a frozen screen can seem “broken.” Some recommended UI fixes:- Use skeleton boxes shaped like the content, not a generic spinner.
- Echo the user’s input back optimistically while the fetch runs.
- Have a graceful “we couldn’t find this one” state ready for 400 responses (
NOT_FOUNDorWEBSITE_ACCESS_ERROR) and sparse records.
9. Keep your API key on the server
Your API key is a bearer credential: whoever holds it can spend your credits and burn your rate limit. Treat it exactly like a database password. That means it never ships in front-end code, where anyone with devtools can read it. The one exception is Logo Link, which uses a separatepublicClientId credential built to be safe in the client-side browser. See Get logos from a domain.
Related resources
Prefetch
Warm the cache before the user-facing call.
Rate limits
Stay under the per-minute request cap.
Tag requests
Attribute credit usage to environments, teams, or features.
Fair use
Responsible use of brand data and scraped content.
Troubleshooting
Error codes and recovery patterns.