GDP API
Nominal, Real & Deflator
Snapshot + Live FRED
Growth Calculations

US GDP data. Growth included.

Nominal, real, and deflator datasets with QoQ, annualized QoQ, and YoY growth already calculated — snapshot mode always on, live FRED mode when you need it.

3 · datasetsQoQ/YoY · growthCompare · cross-datasetSnapshot · always on

Pull any GDP dataset, instantly.

This calls the live GDP API in snapshot mode. Switch between nominal, real, and deflator datasets.

Request builder
Dataset in, latest value out.
GET /gdp
Growth and comparison
GET /growth returns QoQ, annualized QoQ, and YoY calculations. GET /compare returns multiple datasets side by side in one call.
Output preview
Live response from the API, plus the exact request to reproduce it.

Loading live value...

Why GDP API

Every angle on GDP.

Three datasets, one API

Nominal GDP, real (inflation-adjusted) GDP, and the GDP deflator, selected with a single dataset parameter.

Snapshot always available

Snapshot mode never depends on an upstream key, so your demo and staging environments always return data.

Live FRED mode

Pass source=live to hit FRED directly when FRED_API_KEY is configured, or auto to let the server decide.

Growth built in

GET /growth returns QoQ, annualized QoQ, and YoY percentages so you never compute period math client-side.

Cross-dataset comparison

GET /compare returns latest values and changes for any set of datasets in a single request.

Catalog discovery

GET /catalog returns dataset metadata and every valid query option for building dynamic pickers.

/api/v1/gdp

Endpoints, at a glance.

Latest value, history, growth calculations, cross-dataset comparison, and catalog discovery — all GET, snapshot mode always available.
GET/api/v1/gdp

Latest value

Latest datapoint for the selected dataset and source mode.

PRIMARY
GET/api/v1/gdp/history

History

Historical observations by period window, with optional date-range filtering.

GET/api/v1/gdp/growth

Growth

Trailing observations plus QoQ, annualized QoQ, and YoY growth calculations.

GET/api/v1/gdp/compare

Compare

Latest values and changes for a requested set of datasets.

GET/api/v1/gdp/catalog

Catalog

Dataset metadata and valid query option sets.

ParameterTypeRequiredDescription
datasetstringnonominal, real, or deflator. Defaults to nominal.
datasetsstringnoComma-separated dataset list for /compare. Defaults to all.
sourcestringnoauto, snapshot, or live. Defaults to auto.
periodstringnolatest, 1y, 5y, or 10y for history-oriented endpoints.
pointsintegernoTrailing observations for /growth. 2 to 80, default 12.
startDate / endDatestringnoInclusive date bounds (YYYY-MM-DD) for history/growth.

Error reference

Failures you can plan for.

Snapshot mode never triggers a 503 — only requesting source=live without a configured FRED key does.
400Validation Error

Invalid query parameter values or ranges.

401Authentication Error

Missing or invalid gateway API key. Send x-api-key or api_key with every request.

404Not Found

Unknown route under /api/v1/gdp.

429Rate Limit Error

More than 200 requests in a 15-minute window per IP.

502Upstream Error

Live source call to FRED failed.

503Feature Gated

source=live requested without FRED_API_KEY configured server-side.

Example gated response (503)

{
  "success": false,
  "available": false,
  "feature": "gdp-live-data",
  "reason": "This feature requires FRED API key. Contact Datpaq to enable.",
  "correlationId": "1784849006675-l88eays9m"
}

FAQ

API questions developers ask first.

What GDP datasets are available?

Nominal GDP, real (inflation-adjusted) GDP, and the GDP deflator. Select any with dataset=nominal, real, or deflator.

What's the difference between snapshot and live source mode?

Snapshot mode is always available and returns the latest cached dataset. Live mode calls FRED directly and requires a FRED_API_KEY to be configured — pass source=live, source=snapshot, or leave it as source=auto to let the server decide.

How is growth calculated?

GET /growth returns trailing observations plus a changes object with qoq_percent, qoq_annualized_percent, and yoy_percent so you don't need to compute period-over-period math yourself.

Can I compare multiple datasets at once?

Yes. GET /compare accepts a comma-separated datasets list (defaults to all three) and returns latest values and changes for each in one response.

How do I authenticate requests?

Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.

Add US GDP data in one request.

Nominal, real, and deflator datasets with growth calculations and cross-dataset comparison, backed by FRED.