xbrl.history
Trace every SEC EDGAR filing version of one XBRL concept by exact fiscal dates and unit, including unchanged repeats and source filings.
https://api.kanagu.dev/v1/xbrl/history- Price
- $0.08 per successful call
- Without a key
- 10 free calls per IP per UTC day, shared by REST and MCP.
- MCP tool
xbrl.historyathttps://api.kanagu.dev/mcp- Markdown
- /docs/xbrl.history.md
curl https://api.kanagu.dev/v1/xbrl/history \
-H "Content-Type: application/json" \
-d '{"cik":"0000789019","concept":{"taxonomy":"us-gaap","tag":"NetIncomeLoss"}}'curl https://api.kanagu.dev/v1/xbrl/history \
-H "Authorization: Bearer $KANAGU_KEY" \
-H "Content-Type: application/json" \
-d '{"cik":"0000789019","concept":{"taxonomy":"us-gaap","tag":"NetIncomeLoss"}}'const res = await fetch("https://api.kanagu.dev/v1/xbrl/history", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KANAGU_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"cik": "0000789019",
"concept": {
"taxonomy": "us-gaap",
"tag": "NetIncomeLoss"
}
}),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "xbrl.history",
"arguments": {
"cik": "0000789019",
"concept": {
"taxonomy": "us-gaap",
"tag": "NetIncomeLoss"
}
}
}
}{
"cik": "0000789019",
"concept": {
"taxonomy": "us-gaap",
"tag": "NetIncomeLoss"
}
}Request body
application/json
cikstring | integer (1 to 9999999999)required- SEC Central Index Key, with or without leading zeros.
conceptobjectrequiredconcept.taxonomystringrequired- SEC taxonomy, e.g. us-gaap.
concept.tagstringrequired- Case-sensitive XBRL concept tag.
Response
200 · application/json
cikstringrequired- Ten-digit SEC Central Index Key.
sourcestring (uri)required- SEC EDGAR XBRL API documentation.
conceptobjectrequiredconcept.taxonomystringrequired- SEC taxonomy, e.g. us-gaap.
concept.tagstringrequired- Case-sensitive XBRL concept tag.
seriesarray of objectrequiredseries[].periodobjectrequiredseries[].period.startstring (date)- First day of a duration fact. Omit for an instant fact.
series[].period.endstring (date)required- Last day of a duration fact or date of an instant fact.
series[].unitstringrequiredseries[].versionsarray of objectrequired
Try it
Errors
Errors are JSON {"error":{"code","message"}}. An operation may add its own 400 codes; the message says what to fix.
| Status | Code and meaning |
|---|---|
| 400 | invalid_inputThe body does not match the request schema. The message names each field. |
| 400 | invalid_jsonThe body is missing or is not valid JSON. |
| 400 | invalid_idempotency_keyIdempotency-Key must be 1–128 visible ASCII characters. |
| 401 | invalid_api_keyThe Bearer key is missing, malformed, invalid or inactive. |
| 402 | free_allowance_exhaustedThis month's free usage is used up and the account has no subscription. Subscribe from the dashboard, or wait for the next UTC month; Retry-After gives the seconds left. |
| 404 | not_foundNo operation at this path. |
| 409 | idempotency_conflictThe Idempotency-Key was already used with a different body. |
| 413 | payload_too_largeJSON bodies may be at most 64 KiB. |
| 429 | trial_limitThe anonymous trial allows 10 calls per IP per UTC day, shared by REST and MCP. Retry-After gives the seconds left. |
| 500 | internal_errorThe call failed on our side. It is not billed; retry with the same Idempotency-Key. |
JSON Schema
Request schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cik": {
"description": "SEC Central Index Key, with or without leading zeros.",
"anyOf": [
{
"type": "string",
"pattern": "^\\d{1,10}$"
},
{
"type": "integer",
"minimum": 1,
"maximum": 9999999999
}
]
},
"concept": {
"type": "object",
"properties": {
"taxonomy": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]{0,19}$",
"description": "SEC taxonomy, e.g. us-gaap."
},
"tag": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]{0,254}$",
"description": "Case-sensitive XBRL concept tag."
}
},
"required": [
"taxonomy",
"tag"
],
"additionalProperties": false
}
},
"required": [
"cik",
"concept"
],
"additionalProperties": false,
"examples": [
{
"cik": "0000789019",
"concept": {
"taxonomy": "us-gaap",
"tag": "NetIncomeLoss"
}
}
]
}Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cik": {
"type": "string",
"description": "Ten-digit SEC Central Index Key."
},
"source": {
"type": "string",
"format": "uri",
"description": "SEC EDGAR XBRL API documentation."
},
"concept": {
"type": "object",
"properties": {
"taxonomy": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]{0,19}$",
"description": "SEC taxonomy, e.g. us-gaap."
},
"tag": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]{0,254}$",
"description": "Case-sensitive XBRL concept tag."
}
},
"required": [
"taxonomy",
"tag"
],
"additionalProperties": false
},
"series": {
"type": "array",
"items": {
"type": "object",
"properties": {
"period": {
"type": "object",
"properties": {
"start": {
"description": "First day of a duration fact. Omit for an instant fact.",
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"end": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Last day of a duration fact or date of an instant fact."
}
},
"required": [
"end"
],
"additionalProperties": false
},
"unit": {
"type": "string"
},
"versions": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"status": {
"type": "string",
"const": "reported"
},
"filed": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"fact": {
"type": "object",
"properties": {
"cik": {
"type": "string"
},
"taxonomy": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]{0,19}$",
"description": "SEC taxonomy, e.g. us-gaap."
},
"tag": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]{0,254}$",
"description": "Case-sensitive XBRL concept tag."
},
"start": {
"description": "First day of a duration fact. Omit for an instant fact.",
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"end": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Last day of a duration fact or date of an instant fact."
},
"unit": {
"type": "string"
},
"value": {
"type": "number"
},
"fiscalYear": {
"description": "Fiscal year of the filing, as supplied by SEC EDGAR.",
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"fiscalPeriod": {
"description": "Fiscal period of the filing, as supplied by SEC EDGAR.",
"type": [
"string",
"null"
]
},
"form": {
"type": "string"
},
"filed": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"accession": {
"type": "string",
"pattern": "^\\d{10}-\\d{2}-\\d{6}$"
},
"frame": {
"description": "Current SEC calendar frame metadata, when present.",
"type": "string"
},
"acceptedAt": {
"description": "SEC submission acceptance time, used to order same-day filings.",
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"filingUrl": {
"type": "string",
"format": "uri"
}
},
"required": [
"cik",
"taxonomy",
"tag",
"end",
"unit",
"value",
"form",
"filed",
"accession",
"filingUrl"
],
"additionalProperties": false
}
},
"required": [
"status",
"filed",
"fact"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"status": {
"type": "string",
"const": "needs_review"
},
"filed": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"candidates": {
"type": "array",
"items": {
"type": "object",
"properties": {
"cik": {
"type": "string"
},
"taxonomy": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]{0,19}$",
"description": "SEC taxonomy, e.g. us-gaap."
},
"tag": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]{0,254}$",
"description": "Case-sensitive XBRL concept tag."
},
"start": {
"description": "First day of a duration fact. Omit for an instant fact.",
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"end": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
"description": "Last day of a duration fact or date of an instant fact."
},
"unit": {
"type": "string"
},
"value": {
"type": "number"
},
"fiscalYear": {
"description": "Fiscal year of the filing, as supplied by SEC EDGAR.",
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"fiscalPeriod": {
"description": "Fiscal period of the filing, as supplied by SEC EDGAR.",
"type": [
"string",
"null"
]
},
"form": {
"type": "string"
},
"filed": {
"type": "string",
"format": "date",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
},
"accession": {
"type": "string",
"pattern": "^\\d{10}-\\d{2}-\\d{6}$"
},
"frame": {
"description": "Current SEC calendar frame metadata, when present.",
"type": "string"
},
"acceptedAt": {
"description": "SEC submission acceptance time, used to order same-day filings.",
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"filingUrl": {
"type": "string",
"format": "uri"
}
},
"required": [
"cik",
"taxonomy",
"tag",
"end",
"unit",
"value",
"form",
"filed",
"accession",
"filingUrl"
],
"additionalProperties": false
},
"description": "Conflicting facts or filings whose order could not be determined."
}
},
"required": [
"status",
"filed",
"candidates"
],
"additionalProperties": false
}
]
}
}
},
"required": [
"period",
"unit",
"versions"
],
"additionalProperties": false
}
}
},
"required": [
"cik",
"source",
"concept",
"series"
],
"additionalProperties": false
}