# Quickstart: REST with curl

You need an API key from an active Plus, Pro or Ultra plan (sign in at https://stocks.team/account,
then Dashboard > API Keys; the secret is shown once). Keep it in an environment variable, never in a URL.

<!-- example: shell-config -->
```bash
export STOCKS_TEAM_API_KEY="st_live_..."   # your key
```

Ask for Apple's latest annual revenue, one exact fiscal year, in the compact shape:

<!-- example: run -->
```bash
curl -sS -G "https://stocks.team/api/v1/entities/AAPL/statements" \
  -H "X-API-Key: $STOCKS_TEAM_API_KEY" \
  --data-urlencode "statement=income" --data-urlencode "period_type=annual" \
  --data-urlencode "periods=1" --data-urlencode "fields=revenue,bank_net_revenue" \
  --data-urlencode "shape=compact"
```

<!-- example: response 200 -->
```json
{
  "data": {
    "shape": "stocks.team.compact.v1",
    "statement": "income",
    "defaults": { "unit": "USD", "status": "reported", "taxonomy": "us-gaap" },
    "columns": [{ "p": ["annual", "2025-09-28", "2026-09-26", 2026, "FY"], "s": "s1" }],
    "rows": {
      "revenue": ["478834000000"],
      "bank_net_revenue": [{ "empty": "not_applicable", "code": "NOT_APPLICABLE_ENTITY_TYPE" }]
    },
    "concepts": { "revenue": "RevenueFromContractWithCustomerExcludingAssessedTax" },
    "sources": { "s1": "0000320193-26-000026 10-K 2026-11-03 COMPANYFACTS_CONTEXT_LIMITED" }
  },
  "meta": { "shape": "compact" }
}
```

How to read it:

- **The answer.** Revenue for fiscal 2026 (2025-09-28 to 2026-09-26) is `478834000000` USD, an exact
  decimal string. Never parse it as a float. The API answers the latest fiscal year it has published;
  add `period_end=2026-09-26` to pin this one.
- **The source.** `s1` is the 10-K with accession `0000320193-26-000026`, filed 2026-11-03. Its filing
  index is `https://www.sec.gov/Archives/edgar/data/320193/000032019326000026/`.
- **The quality tier.** `defaults.quality` (not shown above) applies to every cell that does not state
  its own `q`. `verified` means the value was matched fact by fact to the company's original Inline XBRL
  filing; `validated` means a value from the SEC's Company Facts aggregate that fails no deterministic
  validation rule and is corroborated at least once; `review_required` means it is neither matched to the
  original filing nor corroborated yet (method: https://stocks.team/data-quality). Tiers rise as filings are
  matched: on 23 November 2026 this revenue cell was served `validated`.
- **An empty cell is never zero.** `bank_net_revenue` is empty with state `not_applicable` and reason
  `NOT_APPLICABLE_ENTITY_TYPE`: it is a banking line and Apple is not a bank. Every code is explained by
  `GET /api/v1/codes?codes=NOT_APPLICABLE_ENTITY_TYPE`.

Next: [agent recipes](https://stocks.team/guides/agent-recipes.md) · [errors](https://stocks.team/guides/errors.md) ·
OpenAPI https://stocks.team/api/openapi.json
