# Batches

Many companies in one call: up to 50 on most routes.

```bash
curl "https://api.gloom.sh/v1/kpis?symbols=AAPL,brk-b,QQZZX" \
  -H "Authorization: Bearer $GLOOM_DATASETS_KEY"
```

```json
{
  "data": [
    { "symbol": "AAPL", "key": "…", "latest": { … } },
    { "symbol": "AAPL", "key": "…", "latest": { … } },
    { "symbol": "BRK.B", "key": "…", "latest": { … } }
  ],
  "meta": {
    "symbols": [
      { "input": "AAPL", "symbol": "AAPL", "status": "ok" },
      { "input": "brk-b", "symbol": "BRK.B", "status": "ok" },
      { "input": "QQZZX", "symbol": "QQZZX", "status": "not_found" }
    ]
  }
}
```

- Up to 50 listings a call, in any notation: `AAPL`, `BRK-B`, `BRK/B`, `AIR.PA`, `VOD:XLON`, `7203:TSE`. The venue may come first: `TYO:7203`, `NASDAQ:AAPL`, `HKEX:9988`. Taiwan's `XTAI` reads as TWSE. A Hong Kong code reads with or without its leading zeros: `700.HK`, `0700.HK` and `00700.HK`, as HKEXnews prints it, are Tencent's `0700`; `80700.HK` is its own counter. Reuters codes for US listings read too: `AAPL.O` and `AAPL.OQ` (Nasdaq), `IBM.N` (NYSE). `data` is one list across the listings read, in the order sent; each row names its listing in `symbol`.
- Each `ok` listing costs the route's price: this call, 4 credits. `empty`, `not_found` and `unavailable` are free:
- `empty`: a listing Gloom knows, with no rows in this dataset for what was asked, or one the dataset does not cover: a company listed abroad on the insider routes, which read Form 4s filed with SEC. An `outside_coverage` notice names the listings not read for that reason. On `/v1/companies`, a profile with none of the `fields` asked for, `symbol` aside, is `empty` too.
- `not_found`: no listing Gloom knows by that notation, such as a typo. Gloom knows the companies it covers, every ticker SEC lists and the listings delisted since its history starts. One rule on every route that takes `symbols`. `/v1/market/bars` and `/v1/market/snapshot` read indexes, funds, coins and other instruments too: a symbol there is `not_found` when Gloom has no prices for it, from a listing that trades or a delisted one. Options and perps routes report a listing with no rows as `empty`.
- `unavailable`: not read just now. Retry shortly, as the `retry_unavailable` notice says.
- On `/v1/filings` and `/v1/fundamentals/statements`, each listing read also gives `cik`, the SEC Central Index Key of the company whose rows were read, ten digits: with `asOf`, the company that held the symbol then. `DOC` read at 2021-01-04 gives Physicians Realty Trust's `0001574540`, not Healthpeak's.
- One symbol alone that is `not_found`, or that the route refuses, answers its own `4xx` with `param: "symbols"` and a hint, also free. One alone that is `empty` answers `200` with no rows.
- `GET /v1/datasets/cost` follows the same rule: a listing Gloom does not know is `not_found` there too, and not priced. Its price is a ceiling, as its `price_ceiling` notice says: a listing the dataset holds nothing for is free only when the call is made.
- `limit` counts per listing; `meta.next` pages them all.
- A batch takes its whole weight, its price times its listings, from the key's per-minute limit when it starts, and gives back the share of its `empty`, `not_found` and `unavailable` listings when it ends. Batches sent at once share the minute at their full weight: on Desk, 1,200 credits a minute, 24 calls of 50 listings at 1 credit start together, and the next waits for the credits to come back (`429 rate_limited`, with `Retry-After` and `RateLimit-Remaining`). Basic's 300 hold 6. A batch heavier than the whole minute is a free `400`.
- `/v1/search` (50 listings at most), `/v1/insider-trades/changes` (50), `/v1/market/quotes` (10) and `/v1/earnings` (100) read the list at one price. A list in which no listing is found is free, and so is one in which no listing is Gloom's. A list with one found keeps its price, even when that listing is `empty` (no report in the window) or read in part (a quote with no price).

Old paths answer `308` to their new ones until 23 January 2027. The [changelog](https://gloom.sh/datasets/docs/changelog) maps every one.

- [Previous Credits and limits](https://gloom.sh/datasets/docs/credits)
- [Next Fields and blocks](https://gloom.sh/datasets/docs/fields)
