Skip to content

US economic time series by series ID

$0.001 per callUSDC via x402GET /api/us-macro-series

US economic series by series ID, from the agency that publishes each; accepts the common series IDs: GDP and PCE (GDPC1, PCEPI), jobs and prices (UNRATE, CPIAUCSL), Treasury yields (DGS10, T10YIE), money (M2SL), FX (DEXUSEU), rates (FEDFUNDS). Send GET /api/us-macro-series with the required field seriesId and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with seriesId, count, observations, source, sourceSeries and 1 more.

Units and frequencies; other IDs answer 404 listing those served. Sources: U.S. BLS, BEA, U.S. Treasury, Federal Reserve Board and the New York Fed. Agent402 is not affiliated with them.

Category: Live public dataTags: series time-series gdp cpi inflation unemployment fed-funds sofr

Try in playground →

Parameters

NameTypeRequiredDescription
seriesIdstringyesseries ID, one of: UNRATE, UNRATENSA, U6RATE, CIVPART, EMRATIO, PAYEMS, CES0500000003, JTSJOL, CPIAUCSL, CPIAUCNS, CPILFESL, PPIACO, EFFR, DFF, FEDFUNDS, SOFR, OBFR, GFDEBTN, DGS1MO, DGS3MO, DGS6MO, DGS1, DGS2, DGS3, DGS5, DGS7, DGS10, DGS20, DGS30, T10Y2Y, T10Y3M, M1SL, M2SL, M1NS, M2NS, GDP, GDPC1, UNEMPLOY, CLF16OV, CE16OV, USPRIV, MANEMP, AHETPI, AWHAETP, AWHNONAG, JTSJOR, JTSHIR, JTSQUR, CPIUFDSL, CPIENGSL, CUSR0000SAH1, PPIFIS, PCEPI, PCEPILFE, PCE, PCEC96, PI, DSPI, PSAVERT, DEXUSEU, DEXUSUK, DEXUSAL, DEXJPUS, DEXCHUS, DEXCAUS, DEXMXUS, DEXSZUS, DEXKOUS, DEXINUS, DEXBZUS, DTWEXBGS, DTWEXAFEGS, DTWEXEMEGS, MPRIME, TB3MS, TB6MS, TB1YR, GS1, GS2, GS5, GS10, GS20, GS30, DFII5, DFII7, DFII10, DFII20, DFII30, T5YIE, T10YIE Also accepted as series, series_id, id. Up to 40 characters. The example sends GDPC1.
startDatestringnoISO start date (YYYY-MM-DD), optional; without one a Bureau of Labor Statistics series answers its last 10 years, a daily Treasury or exchange-rate series its last 2 calendar years The example sends 2024-01-01.
endDatestringnoISO end date (YYYY-MM-DD), optional The example sends 2024-12-31.
limitnumbernoMax observations, 1-100000 (default 1000)
unitsstring (one of: lin, chg, ch1, pch, pc1, pca, cca, log)noTransformation: lin, chg, ch1, pch, pc1 (YoY %), pca, cca, log One of lin, chg, ch1, pch, pc1, pca, cca, log.
frequencystring (one of: d, w, m, q, sa, a, wef)noAverage to a lower frequency: d, w (weeks ending Friday, also wef), m, q, sa, a (optional) One of d, w, m, q, sa, a, wef.

Example request

curl -i "https://agent402.tools/api/us-macro-series?seriesId=GDPC1&startDate=2024-01-01&endDate=2024-12-31"

Without payment this returns HTTP 402 Payment Required with the exact price for us-macro-series; any x402 v2 or MPP client pays it and retries.

Watch a call get paid

RequestGET /api/us-macro-series
402$0.001 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "seriesId": "GDPC1",
  "count": 4,
  "observations": [
    {
      "date": "2024-01-01",
      "value": 23115.975
    }
  ],
  "source": "U.S. Bureau of Economic Analysis",
  "sourceSeries": "NIPA A191RX (Table 1.1.6, line 1)",
  "terms": "BEA citation guidelines: https://www.bea.gov/help/guidelines-for-citing-bea"
}
FieldTypeAlways presentIn the example
seriesIdstringyesGDPC1
countnumberyes4
observationsarray of objectsyes1 item in the example
sourcestringyesU.S. Bureau of Economic Analysis
sourceSeriesstringyesNIPA A191RX (Table 1.1.6, line 1)
termsstringyesBEA citation guidelines: https://www.bea.gov/help/guidelines-for-citing-bea

From an MCP client

catalog.call {
  "slug": "us-macro-series",
  "params": {
    "seriesId": "GDPC1",
    "startDate": "2024-01-01",
    "endDate": "2024-12-31"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for us-macro-series; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.17.1.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.001" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/us-macro-series?seriesId=GDPC1&startDate=2024-01-01&endDate=2024-12-31");

No wallet yet? Fund a first one with USDC on Base, no ETH needed, or run npx -y agent402-mcp@0.17.1 wallet new to make one on this computer: it stores the key and prints the address and the config, never the key.

The quote (Python)

Standard library only: the 402 and the price its PAYMENT-REQUIRED header quotes on each chain. To pay from Python, sign it with any x402 client.

import base64, json, urllib.error, urllib.request

req = urllib.request.Request("https://agent402.tools/api/us-macro-series?seriesId=GDPC1&startDate=2024-01-01&endDate=2024-12-31", method="GET", headers={})
try:
    urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
    quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
    print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]])  # the price, per chain, in base units

Part of these workflows

US economic time series by series ID is one step in these 4 skill packs, each sold as a single call:

Related tools

World Bank indicator series

$0.005GET /api/world-bank-indicator

Fetch a World Bank indicator time series for a country (e.g.

US CPI year-over-year inflation

$0.005GET /api/cpi-yoy

Latest US Consumer Price Index year-over-year inflation rate (headline CPI-U, seasonally adjusted) plus the trailing 12.

Sahm Rule recession indicator

$0.005GET /api/sahm-rule

Sahm Rule recession indicator, computed from the U.S.

US Treasury yield history

$0.005GET /api/treasury-yield-history

Daily history of US Treasury par yields over the last N business days, oldest first: one row per day with recordDate.

US unemployment rate (UNRATE)

$0.005GET /api/unemployment-rate

Latest US unemployment rate (current, as of date) plus a trailing N-month history of {date, value} for trend, seasonally.

Effective federal funds rate

$0.005GET /api/fed-funds

Current effective federal funds rate (current, as of date, in percent) plus a trailing N-day history of {date, value}.