# US Treasury Yields & Bond Data — Curve API (`nexgendata/treasury-yields-bonds`) Actor

Track US Treasury yield curve from 1M to 30Y — daily yields, spreads, 2s10s curve inversion, historical changes. FRED + Treasury.gov public data for fixed income desks, asset allocators, macro hedge funds, treasury teams. Bloomberg yield curve alternative, no terminal needed. Pay-per-result.

- **URL**: https://apify.com/nexgendata/treasury-yields-bonds.md
- **Developed by:** [NexGenData](https://apify.com/nexgendata) (community)
- **Categories:** Business, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 yield records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## US Treasury Yields & Bond Data

US Treasury Yields & Bond Data is a NexGenData tool on Apify that returns daily yields from 1-month to 30-year, spreads and curve inversion from FRED and Treasury.gov.

US Treasury yield and bond public data — the curve, tenors and daily rates.

> Factual public records — not financial, investment or compliance advice. Screening data is provided as-is for your own compliance program.

### 📊 Sample Output

![4 real rows delivered by US Treasury Yields & Bond Data — Curve API — run OwBeFicjKyyIiBdqz on build 0.0.19](https://api.apify.com/v2/key-value-stores/8gLgXMBveEI1tTz1z/records/treasury-yields-bonds-sample)

| `instrument` | `tenor` | `tenor_years` | `yield_pct` | `as_of_date` | `data_source` |
|---|---|---|---|---|---|
| US Treasury 2-Year Constant Maturity | 2Y | 2 | 4.87 | 2026-09-24 | Treasury.gov — Daily Treasury Par Yield Curve |
| US Treasury 5-Year Constant Maturity | 5Y | 5 | 5.03 | 2026-09-24 | Treasury.gov — Daily Treasury Par Yield Curve |
| US Treasury 10-Year Constant Maturity | 10Y | 10 | 5.18 | 2026-09-24 | Treasury.gov — Daily Treasury Par Yield Curve |
| US Treasury 30-Year Constant Maturity | 30Y | 30 | 5.47 | 2026-09-24 | Treasury.gov — Daily Treasury Par Yield Curve |

Real rows from run `OwBeFicjKyyIiBdqz` on build 0.0.19 (2026-09-25), unedited apart from masked emails/phones and shortened long text; fields the source does not publish are empty.

### ⚙️ Sample inputs

This is the Store example input — the same input Apify's automated check runs — so it is proven to return rows on the current build. Paste it into the input form, or send it through the API, CLI or a schedule:

```json
{
  "tenors": [
    "2Y",
    "5Y",
    "10Y",
    "30Y"
  ],
  "date_range": "today",
  "include_historical": false
}
```

### 🔧 Input reference

| Field | Type | Default | What it does |
|---|---|---|---|
| `tenors` | array | `["2Y", "5Y", "10Y", "30Y"]` | List of Treasury tenors to fetch. Supported values: 1M, 3M, 6M, 1Y, 2Y, 3Y, 5Y, 7Y, 10Y, 20Y, 30Y. Leave empty for the full curve. |
| `date_range` | string (today, last_30d, last_90d, ytd) | `"today"` | Range of historical observations to include. 'today' returns just the latest print, 'last_30d' / 'last_90d' / 'ytd' return full history per tenor. |
| `include_historical` | boolean | `false` | If true, emit one record per (tenor, date) for the selected date_range. If false, emit only the most recent record per tenor with rolling 1d/1w/1m/YTD change context. |

### 🧾 JSON sample record

One real record from run `OwBeFicjKyyIiBdqz` (emails/phones masked, long text shortened):

```json
{
  "instrument": "US Treasury 2-Year Constant Maturity",
  "tenor": "2Y",
  "tenor_years": 2,
  "yield_pct": 4.87,
  "as_of_date": "2026-09-24",
  "change_bps_1d": 2,
  "change_bps_1w": 20,
  "change_bps_1m": 70,
  "change_bps_ytd": 140,
  "series_id": "DGS2",
  "curve_segment": "belly",
  "2s10s_spread_bps": 31,
  "inverted": false,
  "data_source": "Treasury.gov — Daily Treasury Par Yield Curve"
}
```

### 💰 Pricing

| Event | Price (USD) | When it is charged |
|---|---|---|
| Actor Start (`apify-actor-start`) | $0.01 | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). |
| Yield record (`apify-default-dataset-item`) | $0.1 | Charged per Treasury yield record returned with tenor, yield, daily/weekly/monthly/YTD changes in bps, curve context. |

Pay-per-event: you pay only for what the run delivers. A run that delivers nothing bills no result events (only the actor-start event, when the actor defines one). Example: a run that delivers 100 results costs 100 × $0.1 = $10.00 plus the start fee.

### 🔗 Related Actors

More from the NexGenData **Data APIs** family:

- [SERP Rank Tracker Lite](https://apify.com/nexgendata/serp-rank-tracker-lite?fpr=2ayu9b)
- [Similarweb Traffic Intelligence](https://apify.com/nexgendata/similarweb-traffic-intelligence?fpr=2ayu9b)
- [Stock Buyback Announcement Tracker — EDGAR API](https://apify.com/nexgendata/stock-buyback-announcement-tracker?fpr=2ayu9b)
- [Walmart Scraper — Product Prices & Listings API](https://apify.com/nexgendata/walmart-scraper?fpr=2ayu9b)
- [Yahoo Finance Scraper — Stocks & Market Data](https://apify.com/nexgendata/yahoo-finance-scraper?fpr=2ayu9b)

28 more in this family on the [NexGenData Store page](https://apify.com/nexgendata?fpr=2ayu9b).

### ⏰ Run this as a monitoring subscription (recommended)

Regulatory data is monitoring data. Schedule a weekly sweep (`0 8 * * 1`) and catch new records as they post — an always-on official-records feed.

### 📊 What you get

Clean JSON, one record per record (full output has 14 fields):

- `2s10s_spread_bps` — 2s10s spread bps
- `as_of_date` — As of date
- `change_bps_1d` — Change bps 1d
- `change_bps_1m` — Change bps 1m
- `change_bps_1w` — Change bps 1w
- `change_bps_ytd` — Change bps ytd
- `curve_segment` — Curve segment
- `data_source` — Data source
- `instrument` — Instrument
- `inverted` — Inverted
- `series_id` — Series id
- `tenor` — Tenor
- `tenor_years` — Tenor years
- `yield_pct` — Yield pct

**Pricing:** $0.100 per record (Pay-Per-Event) — about **10 records per $1**.

### 🤖 Use with AI agents

Point Claude, the OpenAI Agents SDK, an n8n flow or any MCP-aware client at it and pull official records on demand.

**Agentic payments (x402):** Supports agentic payment via x402 — agents can call this actor with USDC, no API key required.

### 🔗 Related regulatory actors

**US government data & filings:**

[Federal Register](https://apify.com/nexgendata/federal-register-rules-scraper) · [Treasury Auctions](https://apify.com/nexgendata/us-treasury-auction-results) · [FEC Expenditures](https://apify.com/nexgendata/fec-independent-expenditures-scraper) · [FEC Contributions](https://apify.com/nexgendata/fec-campaign-finance-intelligence) · [IRS 990](https://apify.com/nexgendata/irs-990-nonprofit-explorer-scraper) · [Nonprofit 990 Records](https://apify.com/nexgendata/nonprofit-irs-990-intelligence)

**Company registries:** [Delaware](https://apify.com/nexgendata/delaware-corporations-search-scraper) · [US State Filings](https://apify.com/nexgendata/business-registration-lookup) · [India MCA](https://apify.com/nexgendata/ogd-india-companies-registry) · [GLEIF LEI](https://apify.com/nexgendata/gleif-lei-entity-resolution) · [UK PSC](https://apify.com/nexgendata/uk-psc-beneficial-ownership) · [HK Registry](https://apify.com/nexgendata/hk-companies-registry) · [Taiwan MOEA](https://apify.com/nexgendata/taiwan-moea-company-registry)

***

*Public official records and enforcement data, assembled for research and monitoring.*

### 🤖 Use with AI agents

Structured JSON for LLM and agent pipelines (Claude, the OpenAI Agents SDK, n8n or any MCP-aware client).

**Sample agent prompt:**

```
Show the US 2-, 10- and 30-year Treasury yields today and their change over the last month.
```

# Actor input Schema

## `tenors` (type: `array`):

List of Treasury tenors to fetch. Supported values: 1M, 3M, 6M, 1Y, 2Y, 3Y, 5Y, 7Y, 10Y, 20Y, 30Y. Leave empty for the full curve.

## `date_range` (type: `string`):

Range of historical observations to include. 'today' returns just the latest print, 'last_30d' / 'last_90d' / 'ytd' return full history per tenor.

## `include_historical` (type: `boolean`):

If true, emit one record per (tenor, date) for the selected date_range. If false, emit only the most recent record per tenor with rolling 1d/1w/1m/YTD change context.

## Actor input object example

```json
{
  "tenors": [
    "2Y",
    "5Y",
    "10Y",
    "30Y"
  ],
  "date_range": "today",
  "include_historical": false
}
```

# Actor output Schema

## `results` (type: `string`):

Default dataset of US Treasury Yields & Bond Data — Curve API records (15 fields per row: instrument, tenor, tenor_years, yield_pct, as_of_date, price, change_bps_1d, change_bps_1w, change_bps_1m, change_bps_ytd, series_id, curve_segment…).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tenors": [
        "2Y",
        "5Y",
        "10Y",
        "30Y"
    ],
    "date_range": "today",
    "include_historical": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgendata/treasury-yields-bonds").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "tenors": [
        "2Y",
        "5Y",
        "10Y",
        "30Y",
    ],
    "date_range": "today",
    "include_historical": False,
}

# Run the Actor and wait for it to finish
run = client.actor("nexgendata/treasury-yields-bonds").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tenors": [
    "2Y",
    "5Y",
    "10Y",
    "30Y"
  ],
  "date_range": "today",
  "include_historical": false
}' |
apify call nexgendata/treasury-yields-bonds --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexgendata/treasury-yields-bonds"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/PKC2GqcCdWOaCBJ6x/builds/iwEAywrd8ZmFQfGU0/openapi.json
