Indices · Indicators
Indices indicators SMA
SMA of an index.
GET
/v1/indices/indicators/smaindicesIndicatorsSmaSimple moving average: the mean of the last window values of the chosen series. Computed on the index's value series (indices carry no volume). Values are newest first by default (order=desc); give start_time and end_time to read a range. One request returns at most limit values; meta.coverage.truncated is true when more exist in the range.
Example request
curl -sS --get "https://api.ordermap.si/v1/indices/indicators/sma" \
-H "Authorization: Bearer $ORDERMAP_API_KEY" \
--data-urlencode symbol=SPXconst params = new URLSearchParams({
symbol: "SPX",
});
const res = await fetch(`https://api.ordermap.si/v1/indices/indicators/sma?${params}`, {
headers: { Authorization: `Bearer ${process.env.ORDERMAP_API_KEY}` },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { data, meta } = await res.json();
console.log(data, meta.coverage);Set ORDERMAP_API_KEY to your key. Replace the dates with a recent trading date.
Parameters
8 parameters, 1 required.
| Parameter | Type and limits | Description |
|---|---|---|
symbolqueryrequired | stringat most 10 characterspattern ^[A-Za-z][A-Za-z0-9]{0,9}$ | Index symbol, for example SPX. |
intervalqueryoptional | string1m1h1d1w1modefault 1d | Bar size the indicator is computed on (the feed computes it per time span: minute, hour, day, week or month). |
windowqueryoptional | integerdefault 50min 1max 500 | Number of values the average covers. |
series_queryoptional | stringopenhighlowclosedefault close | Which bar value the indicator uses. |
start_queryoptional | integerunix-msmin 946684800000max 4102444800000 | Earliest value to return (inclusive). Default: the start of your plan's history. |
end_queryoptional | integerunix-msmin 946684800000max 4102444800000 | End of the range (exclusive). |
orderqueryoptional | stringascdescdefault desc | Time order of the values. |
limitqueryoptional | integerdefault 100min 1max 1000 | Values to return. |
Response
| Status | Meaning | Body |
|---|---|---|
200 | Successful response. | Schema below |
400 | Invalid, unknown or repeated parameters, or an invalid cursor. | Error object |
401 | Missing or invalid API key. | Error object |
403 | The plan, dataset release or account state does not allow this request. | Error object |
422 | The request is valid but no data exists for it. | Error object |
429 | Rate limit, burst limit or cooldown; wait Retry-After seconds.Retry-After | Error object |
500 | Internal error. | Error object |
503 | Data temporarily unavailable; retry after Retry-After seconds.Retry-After | Error object |
504 | The request timed out. | Error object |
Authenticated responses carry the X-RateLimit-* headers (see rate limits); 429 and 503 add Retry-After.
200 response body
dataarray<object>required2 fields insidetimestampintegerunix-msrequiredTime the value applies to (the start of its bar). Unix epoch milliseconds (UTC).valuenumberrequiredIndicator value.
metaobjectrequiredMeta object
Example response
{
"data": [
{
"timestamp": 1792036800000,
"value": 5943.27
}
],
"meta": {
"as_of": 1760659200123,
"coverage": {
"complete": true
},
"delay_ms": 0,
"delayed": false,
"request_id": "0199f0c2-5a1e-7c3b-9d4e-2b6f8a1c3d5e",
"source": "index_feed"
}
}Values are illustrative. Missing values are null, never 0.