Timing endpoint
Forecasts
What was expected before each print, so you can measure the surprise, not just the number.
An active Individual subscription and API key are required for every request.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.fxmacrodata.com/v1/predictions/usd/inflation"
import os
import requests
response = requests.get(
"https://api.fxmacrodata.com/v1/predictions/usd/inflation",
headers={"X-API-Key": os.environ["FXMACRODATA_API_KEY"]},
timeout=30,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.fxmacrodata.com/v1/predictions/usd/inflation", {
headers: { "X-API-Key": process.env.FXMACRODATA_API_KEY },
});
const payload = await response.json();
console.log(payload);
What it can do
4 routes in this endpoint
List predictions for one indicator of a currency
Use for forecasts, consensus, official projections, and FXMacroData predictions joined to the announcement they target.
GET/v1/predictions/coverageWhich forecast publishers cover which currency (no API key)
Free, key-free catalogue of forecast coverage across every served currency: which publishers we carry, what class of forecast each produces, and which currencies carry a genuine consensus source. Returns no forecast values -- those require a plan. Use ``/v1/predictions/coverage/{currency}`` for per-indicator detail.
GET/v1/predictions/{currency}Page official forecast vintages from one publisher
Pass prediction_source to select one official publisher. Use /v1/predictions/coverage/{currency} to see available publishers and series without a key.
GET/v1/predictions/coverage/{currency}Per-indicator forecast coverage for one currency (no API key)
Free, key-free per-indicator catalogue for one currency: the publishers covering each indicator, the ``prediction_class`` each produces, whether any of them is a genuine consensus, and the verified archive depth where it has been confirmed. Returns no forecast values -- those require a plan.
Reference
Parameters and response fields
GET /v1/predictions/{currency}/{indicator} List predictions for one indicator of a currency
An active Individual subscription and API key are required for every request.
Returns every available prediction for the requested `currency/indicator pair. Each row is stamped with its original generated_at` and full source provenance (real archived vintage vs FXMacroData's own live-generated forecast, never reconstructed with later data). Per-source archive start dates and market-consensus coverage vary by indicator: see https://fxmacrodata.com/documentation/point-in-time-backtesting?source=api&utm_source=api&utm_medium=referral&utm_campaign=openapi_description&utm_content=docs_link for the exact earliest date per source and indicator before assuming multi-year depth exists for every series.
Authentication: this endpoint requires an API key on every currency, including USD. Anonymous callers receive 401 api_key_required. A 14-day free trial at https://fxmacrodata.com/subscribe?source=api&utm_source=api&utm_medium=referral&utm_campaign=openapi_description&utm_content=subscribe_link opens the full history on every supported currency.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| currencyRequired | path | string | Allowed: 62 currencies. |
| indicatorRequired | path | string | Indicator slug Allowed: 1481 indicators. |
| prediction_class | query | string | Filter by how the forecast was produced. Prefer this over prediction_type: one class can span several legacy types, which is how forecaster_survey returns both the ECB and Philadelphia Fed Surveys of Professional Forecasters. Allowed: compiled_consensus, forecaster_survey, expectations_survey, market_implied, model_nowcast, central_bank_projection, institutional_projection, fxmacrodata. |
| prediction_type | query | string | Optional legacy prediction-type filter, retained unchanged for existing clients. Superseded by prediction_class. Allowed: 9 values. |
| prediction_source | query | string | Optional source identifier filter. |
| official_limit | query | integer | Maximum rows in `official_forecasts` (native-period official forecasts and surveys). 0 omits them. Default: 500. |
| pre_release_only | query | boolean | Return only forecasts with generated_at strictly before the linked announcement_datetime (default: true). FXMacroData only publishes forecasts generated before the announcement, so this flag is informational: setting it to false does not return additional rows. Default: true. |
| seasonality | query | string | Optional seasonal adjustment selector, matching /v1/announcements. |
| frequency | query | string | Optional returned change basis selector, matching /v1/announcements. |
| annualization | query | string | Optional annualization selector, matching /v1/announcements. |
| period_aggregation | query | string | Optional period aggregation selector, matching /v1/announcements. |
| basis | query | string | Optional real/nominal selector, matching /v1/announcements. |
| start_date | query | string | Start date YYYY-MM-DD (period date). Defaults to 180 days before today when omitted. |
| end_date | query | string | End date YYYY-MM-DD (period date). Defaults to 90 days ahead when omitted. |
| limit | query | integer | Maximum number of prediction groups to return in data[]. Use with offset to page through long histories. Defaults to 20. Maximum 100. Default: 20. |
| offset | query | integer | Number of prediction groups to skip from the start of data[]. Use with limit for pagination. Defaults to 0. Default: 0. |
| page | query | integer | One-based page number. When supplied, it takes precedence over offset. |
| before_date | query | string | Return groups strictly before this YYYY-MM-DD period date. Use the previous response's next_cursor for bounded pagination. |
| as_of | query | string | |
| event_compatible_only | query | boolean | Default: false. |
| compact | query | boolean | Opt-in smaller response for calendar and widget use. When true, official_forecasts holds at most 25 rows, each event keeps only the latest run per forecast source and type, and supported_options, selected_series and official_forecast_calendar are omitted. The default (false) returns the full response unchanged. Default: false. |
| api_key | query | string | Deprecated: legacy query-string API key. Still accepted so existing integrations keep working, but new integrations must send the key in the X-API-Key header (or Authorization: Bearer). A key is required for non-USD, paid-only, or full-history requests. Responses to requests authenticated this way carry a Deprecation header. |
| lang | query | string | Optional language for names and labels, for example es or pt-BR. A regional tag falls back to its base language, and a language that is not yet available returns English with Content-Language: en. Translated fields keep the English text in <field>_original and add a <field>_localized flag. Slugs, field names, codes, dates and values never change. Omit it for English. |
Response fields
| Field | Type | Details |
|---|---|---|
| as_of | string | |
| event_compatible_only | boolean | |
| currency | string | |
| indicator | string | |
| filters | object | The series-variant filters this request was resolved with. A null means the caller did not constrain that dimension. |
| filters.seasonality | string | |
| filters.basis | string | |
| filters.base | string | |
| filters.annualization | string | |
| filters.period_aggregation | string | |
| filters.frequency | string | |
| filters.revisions | string | |
| selected_series_id | string | |
| selected_series | object | The concrete series variant chosen for this response. |
| selected_series.series_id | string | |
| selected_series.label | string | |
| selected_series.source_series_id | string | |
| selected_series.seasonality | string | |
| selected_series.basis | string | |
| selected_series.base | string | |
| selected_series.annualization | string | |
| selected_series.period_aggregation | string | |
| selected_series.frequency | string | |
| selected_series.revisions | string | |
| supported_options | object | |
| prediction_type | string | |
| prediction_class | string | |
| prediction_source | string | |
| pre_release_only | boolean | |
| compact | boolean | True when the request asked for `compact=true: the reference blocks are left out, official_forecasts` holds the newest 25 rows and each event keeps only the latest run per forecast source and type. |
| start_date | string | |
| end_date | string | |
| next_cursor | string | Exclusive before_date cursor for the next page. Prefer this over deep offset pagination to keep reads bounded. |
| has_more | boolean | |
| count | integer | Number of announcement groups returned in `data`. |
| prediction_count | integer | Total number of per-source predictions across all groups. |
GET /v1/predictions/coverage Which forecast publishers cover which currency (no API key)
No API key required.
Free, key-free catalogue of forecast coverage across every served currency: which publishers we carry, what class of forecast each produces, and which currencies carry a genuine consensus source. Returns no forecast values -- those require a plan. Use `/v1/predictions/coverage/{currency}` for per-indicator detail.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| lang | query | string | Optional language for names and labels, for example es or pt-BR. A regional tag falls back to its base language, and a language that is not yet available returns English with Content-Language: en. Translated fields keep the English text in <field>_original and add a <field>_localized flag. Slugs, field names, codes, dates and values never change. Omit it for English. |
GET /v1/predictions/{currency} Page official forecast vintages from one publisher
An active Individual subscription and API key are required for every request.
Read one explicitly named source; bare currency listings stay disabled.
This path never fans out to announcement indicators. Native variables, publication precision and horizons remain those of the publisher.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| currencyRequired | path | string | |
| prediction_source | query | string | Required publisher identifier for source-scoped native forecast history. |
| prediction_class | query | string | Allowed: compiled_consensus, forecaster_survey, expectations_survey, market_implied, model_nowcast, central_bank_projection, institutional_projection, fxmacrodata. |
| statistic | query | string | |
| respondent_population | query | string | |
| start_date | query | string | |
| end_date | query | string | |
| variable | query | string | |
| target_period | query | string | |
| publication_precision | query | string | Allowed: exact, date, unknown. |
| before_id | query | string | |
| limit | query | integer | Default: 100. |
| lang | query | string | Optional language for names and labels, for example es or pt-BR. A regional tag falls back to its base language, and a language that is not yet available returns English with Content-Language: en. Translated fields keep the English text in <field>_original and add a <field>_localized flag. Slugs, field names, codes, dates and values never change. Omit it for English. |
GET /v1/predictions/coverage/{currency} Per-indicator forecast coverage for one currency (no API key)
No API key required.
Free, key-free per-indicator catalogue for one currency: the publishers covering each indicator, the `prediction_class` each produces, whether any of them is a genuine consensus, and the verified archive depth where it has been confirmed. Returns no forecast values -- those require a plan.
Parameters
| Name | In | Type | Details |
|---|---|---|---|
| currencyRequired | path | string | |
| lang | query | string | Optional language for names and labels, for example es or pt-BR. A regional tag falls back to its base language, and a language that is not yet available returns English with Content-Language: en. Translated fields keep the English text in <field>_original and add a <field>_localized flag. Slugs, field names, codes, dates and values never change. Omit it for English. |
Works well with
Endpoints people use alongside Forecasts
The whole API
All 24 endpoint guides
Rates and markets