# Get US CPI, Fed funds and Treasury yield data with x402stock's API

x402stock's US Macro & Rates API returns the main US economic figures together (the Fed funds rate, CPI and PCE inflation, jobs data, real GDP and Treasury yields) from one `GET https://agents.x402stock.xyz/zcj/wsuab16c331i/api/v1/macro` call for $0.05. You can also buy one series at a time from `/api/v1/inflation` ($0.02), `/api/v1/fed-funds` ($0.01) or `/api/v1/treasury-yields` ($0.01), and the upcoming release calendar from `/api/v1/calendar` ($0.02). Each request comes back first as a 402 price quote; pay it and send the request again, with no account or API key.

## At a glance

- **Endpoints:** `GET https://agents.x402stock.xyz/zcj/wsuab16c331i/api/v1/macro`, `/api/v1/inflation`, `/api/v1/fed-funds`, `/api/v1/treasury-yields`, `/api/v1/calendar`. No ticker and no request body.
- **Parameters:** `treasury-yields` takes `limit` (default 1, max 250) and `year` (1990 to 2100). `calendar` takes `days` (default 30, max 90) and `past` (`true` or `false`). The other three take none.
- **Price per request:** macro $0.05, inflation $0.02, fed funds $0.01, Treasury yields $0.01, calendar $0.02
- **Payment:** each call's 402 states its price; settle it in USDC over x402 or MPP, then repeat the call. Nothing to sign up for. Full flow: [the buyer skill](https://agents.x402stock.xyz/zcj/wsuab16c331i/SKILL.md).
- **Response:** JSON with `source` and `as_of` on every response. Data comes from FRED, the US Bureau of Labor Statistics and the US Treasury.
- **Billing:** every request is billed on its own. A 402 you have not paid charges nothing.

## Choose the backdrop or a single series

| You need | Request | Price |
| --- | --- | --- |
| CPI headline and core only | `GET /api/v1/inflation` | $0.02 |
| The effective federal funds rate only | `GET /api/v1/fed-funds` | $0.01 |
| The Treasury par yield curve only | `GET /api/v1/treasury-yields` | $0.01 |
| Several of fed funds, CPI, PCE, labor, GDP and yields | `GET /api/v1/macro` | $0.05 |
| The dates when figures are next released | `GET /api/v1/calendar` | $0.02 |

The backdrop replaces six single-series calls (fed funds, CPI, PCE, labor market, GDP and Treasury yields). Bought separately, those six cost $0.09, against $0.05 for one `/api/v1/macro` call. For two series, such as fed funds and CPI at $0.03, single calls cost less.

## Get the main US figures in one call

1. Send the request without payment:

   ```bash
   curl -i https://agents.x402stock.xyz/zcj/wsuab16c331i/api/v1/macro
   ```

   The storefront answers with a 402 price quote. Nothing is charged at this step, so you can stop here safely.

2. Pay the quote and retry the same request. A standard x402 or MPP client does both for you, and the [buyer skill](https://agents.x402stock.xyz/zcj/wsuab16c331i/SKILL.md) has the steps.

3. Read the response. The top level reports each section's status:

   ```json
   {
     "source": "x402stock",
     "as_of": "2026-10-15T06:55:18.957Z",
     "sections": {"fed_funds": "ok", "cpi": "ok", "pce": "ok", "labor": "ok", "gdp": "ok", "treasury_yields": "ok"}
   }
   ```

   The keys `fed_funds`, `cpi`, `pce`, `labor`, `gdp` and `treasury_yields` each hold one series object, with its own `source` and `as_of`. This example request paid $0.05.

4. Check `sections` before reading a series. Sections degrade independently, and each series key can be `null`.

## Get one series: CPI, Fed funds or Treasury yields

The CPI inflation API returns headline CPI-U and core CPI from the BLS, each with its index level and year-over-year percent, plus recent monthly history:

```bash
curl https://agents.x402stock.xyz/zcj/wsuab16c331i/api/v1/inflation
```

```json
{"source": "us_bls", "as_of": "2026-08-01T00:00:00.000Z", "series": "cpi_u_us_city_average", "unit": "index_1982_84=100",
 "headline": {"latest_index": 334.98, "latest_month": "2026-08", "yoy_percent": 3.4},
 "core": {"latest_index": 338.041, "latest_month": "2026-08", "yoy_percent": 2.45},
 "history": [{"date": "2026-08", "period_name": "August", "value": 334.98}, "… 12 more"]}
```

This example paid $0.02.

The federal funds rate API returns the effective rate as a monthly average in percent, from FRED. It includes the latest value, the prior month, the month-over-month change, the year-over-year change and recent history:

```bash
curl https://agents.x402stock.xyz/zcj/wsuab16c331i/api/v1/fed-funds
```

```json
{"source": "fred", "as_of": "2026-09-01T00:00:00.000Z", "series_id": "FEDFUNDS", "title": "Effective Federal Funds Rate", "unit": "percent", "frequency": "monthly",
 "latest": {"date": "2026-09-01", "value": 3.75}, "prior": {"date": "2026-08-01", "value": 3.63},
 "change": 0.12, "change_percent": 3.31, "yoy_percent": -11.14,
 "history": [{"date": "2026-09-01", "value": 3.75}, "… 23 more"]}
```

This example paid $0.01.

The Treasury yield curve API returns the daily par yield curve in percent and defaults to the latest published day. Set `limit` for more recent days:

```bash
curl "https://agents.x402stock.xyz/zcj/wsuab16c331i/api/v1/treasury-yields?limit=2"
```

```json
{"source": "us_treasury", "as_of": "2026-10-13T00:00:00.000Z", "series": "daily_treasury_par_yield_curve", "unit": "percent",
 "maturities": ["1mo", "… 13 more"], "count": 2,
 "rates": [{"date": "2026-10-13", "rates": {"1mo": 4.1, "1.5mo": 4.15, "2mo": 4.15, "3mo": 4.26, "4mo": 4.32, "6mo": 4.34, "1yr": 4.48, "2yr": 4.79, "3yr": 4.9, "5yr": 5, "7yr": 5.11, "10yr": 5.21, "20yr": 5.6, "30yr": 5.56}}, "… 1 more"]}
```

Each row's `rates` object is keyed by maturity, from `1mo` to `30yr`. This example paid $0.01.

## Get the economic release calendar

The calendar lists curated high-importance US releases within `days`. Each release carries its date and category, and the response adds the next FOMC meeting. The list includes inflation releases (CPI, PPI and PCE), jobs and JOLTS, GDP, and activity data such as retail sales, housing starts and industrial production. Set `past=true` to include the last week.

```bash
curl "https://agents.x402stock.xyz/zcj/wsuab16c331i/api/v1/calendar?days=7"
```

```json
{"source": "fred", "as_of": "2026-10-15T06:55:39.064Z", "window_days": 7, "from": "2026-10-15", "to": "2026-10-22", "count": 6,
 "releases": [{"release_id": 180, "name": "Initial Jobless Claims", "category": "employment", "date": "2026-10-15"}, "… 5 more"],
 "fomc": {"next_meeting": "2026-10-28", "days_until": 13},
 "attribution": "Economic release dates: Federal Reserve Bank of St. Louis (FRED). FOMC meeting d…"}
```

This example paid $0.02.

## Limits

- Data covers the US only. Each series updates on its source's schedule: Fed funds and CPI are monthly, and yields are daily. Read `as_of` and each series' latest date on every response.
- PCE, the labor market and GDP come inside `/api/v1/macro` on this page. Their single-series routes are in the [US Macro & Rates API reference](https://agents.x402stock.xyz/zcj/wsuab16c331i/services/us-macro-rates/openapi.json).
- You can pay by card per call only when the call costs at least $0.50. To fund these calls by card, buy Credits instead: the minimum purchase is $0.50, with an agent identity, at `/plans/{planId}/purchase`. The plan is listed in the manifest.

## Errors

| Response | Meaning | Action |
| --- | --- | --- |
| `402` with a `payment` block | The price quote. Nothing is charged yet. | Pay it and retry the same request, or stop |
| `settlement_failed` | The payment did not settle. `settlementReason` says why, for example `insufficient_funds`. | Fix the wallet, then send a fresh request for a new 402 |
| `payment_request_mismatch` (409) | A payment was reused for a different request | Settle a fresh 402 for each call |
| `payment_consumed` | That payment was already settled | Check whether the original call delivered before paying again |
| `zc-usage-error` header on a served response | The response was delivered, but a billing note is attached | Use the response and do not retry |

## Frequently asked questions

### Is there a US economic data API that needs no API key?

Yes. x402stock's storefront takes no account or API key for these calls. Each request is paid on its own by answering the 402 price quote over x402 or MPP.

### Is the CPI or Fed funds data real-time?

Fed funds is a monthly average, CPI is monthly, and the yield curve defaults to the latest published day. Every response carries `as_of` and the series' latest date or month.

### Is the macro composite cheaper than separate calls?

It is cheaper when you need many series. The six series it bundles cost $0.09 as separate calls, against $0.05 for one call to `/api/v1/macro`. One or two series cost less on their own routes.

### Can I get historical Treasury yields?

Yes. Set `limit` up to 250 for that many recent days, or set `year` to choose a year between 1990 and 2100. Each call is one request at $0.01.

### How do I find when CPI is next released?

Call `/api/v1/calendar` with `days` set to cover the window you need, up to 90. CPI is among the curated releases, and the response also gives the next FOMC meeting date and the days until it.

## Keep reading

- [Buyer skill](https://agents.x402stock.xyz/zcj/wsuab16c331i/SKILL.md): the full purchase flow
- [How to pay](https://agents.x402stock.xyz/zcj/wsuab16c331i/payment.md): x402, MPP, card and Credits
- [US Macro & Rates API reference](https://agents.x402stock.xyz/zcj/wsuab16c331i/services/us-macro-rates/openapi.json): every operation and parameter
- [US Macro & Rates prices](https://agents.x402stock.xyz/zcj/wsuab16c331i/services/us-macro-rates): prices by plan
- [Error reference](https://agents.x402stock.xyz/zcj/wsuab16c331i/errors.md): every error code and the action to take

---

Updated 2026-10-16. All x402stock guides: https://agents.x402stock.xyz/guides.md. Storefront: https://agents.x402stock.xyz/zcj/wsuab16c331i/llms.txt.
