Skip to Content
API ReferenceObservationsList observations

Observations

GET /v1/observations returns time-series rows for an indicator and optional region. This endpoint requires an API key or x402 payment.

Request

curl "https://api.creativeforesight.io/v1/observations?indicator=UNRATE&region=US&limit=12" \ -H "Authorization: Bearer $FORESIGHT_API_KEY"

Query parameters

ParameterTypeRequiredDescription
indicatorstringYesIndicator code, such as UNRATE or cf:labor_composite.
sourcestringNoSource slug for duplicate provider codes.
regionstringNoRegion code. Uses the indicator default region when omitted.
start_datedateNoInclusive lower date bound.
end_datedateNoInclusive upper date bound.
as_ofdateNoRead the series as published by the end of this day (UTC). See Point-in-time reads.
transformstringNoQuery-time transform: yoy, mom, qoq, index:YYYY-MM-DD, or log. See Transforms.
frequencystringNoDownsample to monthly, quarterly, or annual calendar buckets. See Resampling.
resample_methodstringNoBucket aggregation: mean (default), last, or sum. Requires frequency.
limitintegerNoPage size, 0 to 1000. Defaults to 100.
offsetintegerNoPage offset. Defaults to 0.
orderasc or descNoSort order. Defaults to desc.

Observation object

Each row is one period of the series. The indicator, region, unit and source attribution are in meta, once per response.

FieldTypeDescription
period_startdateFirst day of the period.
period_enddate or nullLast day of the period (for weekly series, the source’s own week date).
period_typestring or nulldaily, weekly, monthly, quarterly or annual. A series holds one period type.
valuenumber or nullNumeric value, in meta.unit.
revisioninteger or nullHow many earlier values this period has had. 0 is the first value Foresight holds.
is_preliminaryboolean or nulltrue when the source marks the value preliminary or an early estimate it will revise on schedule.
estimatestring or nullThe source’s name for this estimate, where it publishes a run of them: advance, second or third for BEA’s national accounts.
source_updated_atdate-time or nullWhen the source last updated the data this value comes from (FRED’s series update time, BEA’s table revision date), when the source states one.

The four revision fields describe the stored value; a resampled bucket (frequency=) is an average or sum of several values and carries only the first four fields. Every earlier value of a period is listed by vintages.

Units

meta.unit is one spelling from a fixed vocabulary across every source: percent, percentage points, a currency code with an optional magnitude (USD, USD, billions, EUR, millions), a real-dollar basis in parentheses (USD (chained 2017), billions), persons, count (both with an optional magnitude such as count, thousands), index or an index with its base (index (1982-84=100)), ratio, z-score (standard deviations from a trailing mean), category (a coded label such as a regime quadrant), and rates written as one token (USD_per_hour, AUD_per_EUR).

Response

{ "data": [ { "period_start": "2026-10-01", "period_end": "2026-10-31", "period_type": "monthly", "value": 4.1 } ], "meta": { "indicator": "UNRATE", "region": "US", "unit": "percent", "total": 945, "limit": 12, "offset": 0, "source_attribution": "Contains FRED® data © Federal Reserve Bank of St. Louis" } }

Point-in-time reads (as_of)

Sources revise their numbers, so today’s value for a past period is often not what anyone saw at the time. Add as_of=YYYY-MM-DD to read a series as it was published by the end of that day (UTC): each period at the value it had then, and no period published later. Use it for backtests: a model trained on revised data looks better than it could have been in real time.

# GDP for Q2 2026 as known on 2026-08-01: the advance estimate, before BEA revised it. curl "https://api.creativeforesight.io/v1/observations?indicator=GDP&region=US&start_date=2026-04-01&end_date=2026-04-01&as_of=2026-08-01" \ -H "Authorization: Bearer $FORESIGHT_API_KEY"
  • meta.as_of echoes the date. If nothing had been published yet, data is empty and meta.earliest_as_of says the first date that has a value.
  • A derived cf:* series is computed from its inputs as known that day (meta.computed_as_of: true), not from today’s stored output.
  • FRED series reach back through ALFRED, FRED’s archive of past releases. Other sources are recorded from November 19, 2026: a date before a series’ recorded history returns 400 with details.earliest_as_of, never a later value.
  • transform and frequency work with as_of; their comparators are read as of the same day.

Transforms

Add transform= to get derived values without post-processing:

TransformResultUnit
yoyPercent change vs the same period one year earlier.percent
momPercent change vs the previous period.percent
qoqPercent change vs the previous quarter (quarterly series only).percent
index:YYYY-MM-DDValues rescaled so the base date equals 100.index (BASE=100)
logNatural log of each value.log(unit)
curl "https://api.creativeforesight.io/v1/observations?indicator=UNRATE&region=US&transform=yoy" \ -H "Authorization: Bearer cf_live_REPLACE_ME"

Percent changes compare calendar periods, not row positions: a row whose comparator period is missing from the series returns null rather than a misleading number, and meta.null_values says which period was missing (October 2026 CPI year over year needs October 2025, which was never published). The response meta.unit reflects the transform and meta.transform echoes what was applied. yoy is unavailable on daily series at their native frequency — add frequency=monthly to get monthly year-over-year from daily data.

Resampling

Add frequency= to downsample a series to calendar buckets before any transform runs:

curl "https://api.creativeforesight.io/v1/observations?indicator=DGS2&frequency=monthly&transform=yoy" \ -H "Authorization: Bearer cf_live_REPLACE_ME"

Buckets are labeled by their calendar start date (2026-07-01 for July, Q3, or 2026) and aggregated with resample_method — mean (default), last, or sum. Resampled rows carry the same four fields as stored rows: period_start, period_end, period_type, and value. Requesting a series’ own native frequency returns it unchanged.

Two honesty rules protect you from partial buckets: a trailing bucket the source hasn’t finished (say, July from daily data that ends July 14th) is dropped rather than served as if complete, and when a page is truncated by limit/offset, the buckets at the truncated edges are dropped because they may be missing source rows. meta.resample reports the method, the source and target frequencies, and both kinds of drops. Prefer start_date/end_date windows over pagination when resampling — a full window has no truncated edges.

Paying per request (x402)

Unauthenticated calls return HTTP 402. The JSON body’s accepts describes the payment (USDC on Base); sign it and retry the same request with the payload in the PAYMENT-SIGNATURE header. See Pay per request.

Errors

StatusCodeMeaning
400INVALID_PARAMETERRequired or optional query parameters are invalid.
401INVALID_API_KEYThe request did not include a valid API key and was not a settled x402 request.
404RESOURCE_NOT_FOUNDThe requested indicator or region was not found.
429RATE_LIMIT_EXCEEDEDThe API key exceeded its one-minute request limit.
500INTERNAL_SERVER_ERRORObservation data could not be loaded.
Last updated on