Prerequisites
SECAPI_API_KEY,curl, andjq; Node.js 18+ for the record script.- One issuer identifier. This example uses
AAPL.
1. Identify the source 10-K
accessionNumber, filingDate, filingUrl, and requestId; they identify the
document to inspect when a later fact is surprising. 404 filing_not_found
means the selected issuer/form did not resolve, not that the issuer has never
filed.
2. Retrieve annual revenue observations
resolvedTag records the
concept selected by the service. Values remain in the returned unit, so do not
format them as dollars or compare them to another observation until units and
periods match.
3. Write the source-linked observation record
Createrevenue-record.mjs:
Failure modes
401or403means the process did not send a valid entitled key.- Empty
datacan mean the issuer, filters, or resolved concept did not match; inspectresolvedTagandcompletenessbefore substituting a value. - Do not compare quarterly and annual values, or different units, as though
they are equivalent. Retain
periodStart,periodEnd,fp, andfiledAt. - A restatement changes the observation’s filing context. Decide explicitly whether the model uses the latest restated fact or an originally reported one.

