US economic time series by series ID
GET /api/us-macro-seriesUS 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.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
seriesId | string | yes | series 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. |
startDate | string | no | ISO 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. |
endDate | string | no | ISO end date (YYYY-MM-DD), optional The example sends 2024-12-31. |
limit | number | no | Max observations, 1-100000 (default 1000) |
units | string (one of: lin, chg, ch1, pch, pc1, pca, cca, log) | no | Transformation: lin, chg, ch1, pch, pc1 (YoY %), pca, cca, log One of lin, chg, ch1, pch, pc1, pca, cca, log. |
frequency | string (one of: d, w, m, q, sa, a, wef) | no | Average 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
GET /api/us-macro-series$0.001 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example 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"
}| Field | Type | Always present | In the example |
|---|---|---|---|
seriesId | string | yes | GDPC1 |
count | number | yes | 4 |
observations | array of objects | yes | 1 item in the example |
source | string | yes | U.S. Bureau of Economic Analysis |
sourceSeries | string | yes | NIPA A191RX (Table 1.1.6, line 1) |
terms | string | yes | BEA 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
seriesIdis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. Some calls are paid before they run; a failed one can be retried free with the same payment, or is refunded. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
POSTwith a JSON body to /api/us-macro-series is served as this GET, with the body as the input. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
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 unitsPart of these workflows
US economic time series by series ID is one step in these 4 skill packs, each sold as a single call:
- Financial research - A research one-pager for a single ticker in one pass: recent SEC filings, reported financials, insider filings and macro context.
- Trend analysis - Take any numeric time series - a US economic indicator such as unemployment, CPI or fed funds - and run it through the full quantitative workup: descriptives, moving averages, trend line, outliers, optional correlation against a benchmark, and a deterministic forecast forward with a 95% prediction interval. Everything an analyst writes a notebook for, in one chain of cheap calls.
- Forecasting bake-off - Don't guess which forecasting method to trust. Backtest all four (naive/drift, SES, Holt, Holt-Winters) on a real series, rank by out-of-sample RMSE, then forecast forward with the winner and its 95% prediction interval. Method selection without the hand-waving.
- Fed economic snapshot - Economic snapshot skill: one parallel call returns the fed funds rate, the unemployment rate and the consumer price index series together.
Related tools
World Bank indicator series
Fetch a World Bank indicator time series for a country (e.g.
US CPI year-over-year inflation
Latest US Consumer Price Index year-over-year inflation rate (headline CPI-U, seasonally adjusted) plus the trailing 12.
Sahm Rule recession indicator
Sahm Rule recession indicator, computed from the U.S.
US 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)
Latest US unemployment rate (current, as of date) plus a trailing N-month history of {date, value} for trend, seasonally.
Effective federal funds rate
Current effective federal funds rate (current, as of date, in percent) plus a trailing N-day history of {date, value}.