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®ion=US&limit=12" \
-H "Authorization: Bearer $FORESIGHT_API_KEY"Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
indicator | string | Yes | Indicator code, such as UNRATE or cf:labor_composite. |
source | string | No | Source slug for duplicate provider codes. |
region | string | No | Region code. Uses the indicator default region when omitted. |
start_date | date | No | Inclusive lower date bound. |
end_date | date | No | Inclusive upper date bound. |
as_of | date | No | Read the series as published by the end of this day (UTC). See Point-in-time reads. |
transform | string | No | Query-time transform: yoy, mom, qoq, index:YYYY-MM-DD, or log. See Transforms. |
frequency | string | No | Downsample to monthly, quarterly, or annual calendar buckets. See Resampling. |
resample_method | string | No | Bucket aggregation: mean (default), last, or sum. Requires frequency. |
limit | integer | No | Page size, 0 to 1000. Defaults to 100. |
offset | integer | No | Page offset. Defaults to 0. |
order | asc or desc | No | Sort 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.
| Field | Type | Description |
|---|---|---|
period_start | date | First day of the period. |
period_end | date or null | Last day of the period (for weekly series, the source’s own week date). |
period_type | string or null | daily, weekly, monthly, quarterly or annual. A series holds one period type. |
value | number or null | Numeric value, in meta.unit. |
revision | integer or null | How many earlier values this period has had. 0 is the first value Foresight holds. |
is_preliminary | boolean or null | true when the source marks the value preliminary or an early estimate it will revise on schedule. |
estimate | string or null | The source’s name for this estimate, where it publishes a run of them: advance, second or third for BEA’s national accounts. |
source_updated_at | date-time or null | When 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®ion=US&start_date=2026-04-01&end_date=2026-04-01&as_of=2026-08-01" \
-H "Authorization: Bearer $FORESIGHT_API_KEY"meta.as_ofechoes the date. If nothing had been published yet,datais empty andmeta.earliest_as_ofsays 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
400withdetails.earliest_as_of, never a later value. transformandfrequencywork withas_of; their comparators are read as of the same day.
Transforms
Add transform= to get derived values without post-processing:
| Transform | Result | Unit |
|---|---|---|
yoy | Percent change vs the same period one year earlier. | percent |
mom | Percent change vs the previous period. | percent |
qoq | Percent change vs the previous quarter (quarterly series only). | percent |
index:YYYY-MM-DD | Values rescaled so the base date equals 100. | index (BASE=100) |
log | Natural log of each value. | log(unit) |
curl "https://api.creativeforesight.io/v1/observations?indicator=UNRATE®ion=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
| Status | Code | Meaning |
|---|---|---|
400 | INVALID_PARAMETER | Required or optional query parameters are invalid. |
401 | INVALID_API_KEY | The request did not include a valid API key and was not a settled x402 request. |
404 | RESOURCE_NOT_FOUND | The requested indicator or region was not found. |
429 | RATE_LIMIT_EXCEEDED | The API key exceeded its one-minute request limit. |
500 | INTERNAL_SERVER_ERROR | Observation data could not be loaded. |