GET /v2/snapshot?symbol=AAPL, and code that reads both the success and error envelopes.
Create an API key
Open the keys page athttps://stockcontext.com/dashboard/keys, create a key, and copy it before you close the dialog. The raw secret is shown once. Keys start with sctx_ and travel in the X-API-Key header. New keys start on the Free plan: search, coverage, snapshot, and valuation; see plans and limits for the rest.Set your environment
Make the first call
/v2/snapshot is the best first call for most apps: it returns quote, performance, 52-week range, quick valuation, sector, and industry in one response.Read the success envelope
Success is always wrapped indata. The response below is trimmed; the live payload also carries a full performance block, a range_52w block, and more fundamentals_quick fields. The response model documents the wrapper in full.GET /v2/snapshot?symbol=AAPL (trimmed)
/v2/snapshot, pe_ttm, ps_ttm, pb, and ev_ebitda_ttm each computable value ships as { value, vs_5y? } — read the number at pe_ttm.value. fcf_yield_pct, dividend_yield_pct, the ttm_* fields, shares_outstanding, and beta_5y_weekly stay flat; market_cap_usd and enterprise_value_usd are flat integers.fundamentals_quick.pe_ttm.vs_5y bands the ratio within the symbol’s own five-year history (near_5y_low, below_5y_median, near_5y_median, above_5y_median, near_5y_high, or the _3y_ variants). It is not a cheapness verdict and not a peer comparison. vs_5y is omitted when the history is too thin or the multiple is non-positive; a negative P/E keeps its value at .value and carries a caveat such as negative_earnings_period.Read these before you show or cache the result:data.symbolis the resolved ticker.data.freshnessis one ofintraday,end_of_day,stale,degraded, orunsupported. See freshness.data.market_statusisopenorclosed.data.as_ofis the upstream timestamp when available, otherwise generation time, always UTC ISO-8601.cache_age_secondsis how long the served data has been cached;0means freshly computed.
freshness, market_status, as_of, and cache_age_seconds. _usd fields are whole U.S. dollars and _pct fields are percentages, not decimals; units and fields covers every convention.Handle the error envelope
Failures are always wrapped inerror. Retry only when error.retryable is true.RATE_LIMITED) is retryable; 503 UPSTREAM_UNAVAILABLE and 503 AUTH_UPSTREAM_UNAVAILABLE are too. The four errors below are not — fix the cause before you call again:| Code | HTTP | Fix |
|---|---|---|
UNAUTHORIZED | 401 | Set a valid key in X-API-Key. |
PLAN_UPGRADE_REQUIRED | 403 | The route needs Starter or Builder. |
SYMBOL_INVALID | 400 | Symbol must match the ticker grammar. |
SYMBOL_UNKNOWN | 404 | Resolve the ticker with /v2/search. |
X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset; a 429 carries them too, plus Retry-After in seconds. Other error responses do not include them, so read your budget from successes. The full table and retry policy live on the error codes page.Optional fit checks
Run these before you store a user-entered symbol or kick off batch work.Call it from code
Both clients check the envelope before the HTTP status, because a4xx/5xx still carries a structured error. Keep the key server-side; never ship it to the browser.
- Python
- TypeScript
snapshot.py
Next steps
Most apps callGET /v2/valuation?symbol=AAPL next; it pairs with snapshot and is available on Free keys. It ranks each multiple against the symbol’s own 3/5/10-year history (a percentile plus a label), never against peers or a fair-value target. If your question is not valuation, the endpoint guide maps jobs to routes.
Choose endpoints
Pick the smallest route set for your job.
Errors and retries
Build retry behavior around
error.retryable.Hosted MCP
Connect MCP if you are building agents.