Fields and blocks
Keep the fields you read, add the blocks you need.
bash
curl -G "https://api.gloom.sh/v1/kpis" \
-d symbols=AAPL,MSFT \
-d fields=key,latest \
-d include=methodology \
-H "Authorization: Bearer $GLOOM_DATASETS_KEY"json
{
"data": [
{ "symbol": "AAPL", "key": "…", "latest": { … } },
{ "symbol": "MSFT", "key": "…", "latest": { … } }
],
"included": {
"methodology": { "AAPL": "…", "MSFT": "…" }
},
"meta": { … }
}datais the route's rows, or its one record. A row has every field its schema names, null when the source has no value.fields=keeps the fields named. On a company route, each row keepssymbol.include=adds blocks such as facets, coverage or methodology underincluded. On a company route, each block is keyed by listing.- A few names add a field to each row, or to the record, instead of a block:
include=fullTexton a transcript adds the whole transcript asdata.fullText. The route's reference says which. - Neither changes the price. An unknown name is a free
400that lists the names the route takes; an empty list is as if not sent. - A list may be sent repeated,
fields=key&fields=latest, as many clients send an array: it reads asfields=key,latest. So mayinclude,symbolsand a filter that takes several names. - Each route's reference lists its fields and blocks; the OpenAPI document types every one.