# US Treasury Exchange Rates Scraper (`parseforge/treasury-exchange-rates-scraper`) Actor

Scrapes US Treasury exchange rates by country and date range. Returns each rate as a flat row with currency, effective date, and value. Export to CSV, JSON, Excel, or XML.

- **URL**: https://apify.com/parseforge/treasury-exchange-rates-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Automation, Integrations, Business
- **Stats:** 2 total users, 1 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $7.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### US Treasury Exchange Rates Scraper

**Scrape US Treasury exchange rates for any country and date range, up to a million records per run.** Each rate comes with its currency, effective date, and the exact value published by the Treasury. No login or API key. Export to CSV, JSON, Excel, or XML.

The Treasury's official reporting site only shows one country at a time and makes bulk export a manual chore. This Actor reads the public exchange rate tables directly, filtered by country and date, and returns each published rate in one fixed schema. It is the fastest way to get historical and current US Treasury exchange rates into your spreadsheet or database.

| Who uses it | What they scrape US Treasury for |
|---|---|
| Financial analysts | Building historical currency conversion tables for valuation models |
| Accountants | Getting the official Treasury rate for a specific transaction date |
| Data engineers | Loading daily Treasury rates into a data warehouse for reporting |
| Compliance officers | Documenting the exact Treasury rate used in cross-border filings |
| Researchers | Studying long-term exchange rate movements published by the Treasury |

### What it does

This Actor collects US Treasury exchange rates by country and date range, and returns each rate as a flat row with its currency, effective date, and value.

- 🌍 **Country filter:** enter a country name to get only its rates, or leave empty for all countries.
- 📅 **Date range:** set a start date to pull rates from that day forward, or leave empty for the full history.
- 📊 **Flat output:** every rate is one row with currency, effective date, and value, ready for CSV or JSON.
- ⚡ **Bulk export:** paid users can pull up to 1,000,000 rates in a single run; free users get a 10-rate preview.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with US Treasury data

**📈 Build a historical exchange rate database.**

A financial analyst runs the Actor with no country filter and a start date of 2020-01-01, then loads the CSV into a database to power multi-year currency conversion models.

**🧾 Reconcile a specific transaction.**

An accountant enters the country and the transaction date, gets the exact Treasury rate for that day, and attaches the record to the journal entry for audit support.

**📊 Feed a daily reporting pipeline.**

A data engineer schedules the Actor to run each morning with the previous day's date, then appends the new rates to a warehouse table used by the finance team.

**🛡️ Document compliance rates.**

A compliance officer pulls the Treasury rate for a cross-border payment date and saves the JSON output as evidence of the official rate used in the filing.

**🔍 Study long-term currency trends.**

A researcher runs the Actor for a single country over ten years, then charts the Treasury's published rates to analyze policy-driven movements.

### Why choose this scraper

|  | What you get |
|---|---|
| **Official Treasury data** | Rates come straight from the U.S. Treasury's published tables, not third-party feeds. |
| **No API key** | The Actor reads the public site directly, so you skip registration and rate limits. |
| **One row per rate** | Every result is a flat record with currency, effective date, and value, no nested JSON. |
| **Bulk friendly** | Paid users can export up to a million rates per run for large-scale analysis. |

### How it compares

This Actor focuses on Treasury exchange rates, while the OFAC Sanctions Screener is built for sanctions list screening, so the comparison below highlights the different data each one returns.

| Feature | ParseForge | OFAC Sanctions Screener - Compliance Check |
|---|---|---|
| US Treasury exchange rates | Yes | Not listed |
| Country filter | Yes | Not listed |
| Date range filter | Yes | Not listed |
| OFAC SDN sanctions screening | Not listed | Yes |
| Fuzzy name matching with confidence scores | Not listed | Yes |
| Batch screening for KYC/AML | Not listed | Yes |

### Configure the run

Drive the Actor with a country name and a start date, alone or together, and filters run as each rate is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "startDate": "2026-01-01",
  "maxItems": 10
}
```

A larger pull:

```json
{
  "startDate": "2026-01-01",
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0085 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.85 |
| 1,000 results | $8.50 |
| 10,000 results | $85.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [US Treasury Exchange Rates Scraper](https://apify.com/parseforge/treasury-exchange-rates-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to US Treasury through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/treasury-exchange-rates-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check the country filter. It must be an exact match, for example 'China' not 'china' or 'People's Republic of China'. Also confirm your startDate is not after the latest published rate.

**Why did I only get 10 rates?**

Free users are limited to a 10-rate preview. Upgrade to a paid plan and set maxItems higher to get the full dataset.

**The country filter is not working.**

The filter is case-sensitive and requires the exact country name as it appears on the Treasury site. Try the name without extra words like 'Republic of' or 'People's'.

**Can I get rates before my startDate?**

No. The startDate is inclusive and returns rates from that date forward. To get earlier rates, set an earlier startDate.

**The output has duplicate rows.**

The Treasury sometimes publishes the same rate on consecutive days. Use the effective\_date field to deduplicate in your own pipeline if needed.

### FAQ

| Question | Answer |
|---|---|
| What is the US Treasury exchange rate? | It is the official foreign currency exchange rate published by the U.S. Department of the Treasury for a given currency and effective date. These rates are used for accounting, customs valuation, and tax reporting. |
| Which countries and currencies are covered? | The Actor returns every rate the Treasury publishes, which includes dozens of currencies. Use the country filter to narrow to one country, or leave it empty to get all of them. |
| How far back does the data go? | The Treasury publishes rates going back many years. Set the start date to the earliest date you need, and the Actor will return every rate from that date forward. |
| Do I need an API key or login? | No. The Actor reads the public Treasury reporting site directly, so there is no registration, OAuth, or API key to manage. |
| What does the output look like? | Each rate is one flat row with the currency, effective date, and value. You can export the results as CSV, JSON, Excel, or XML. |
| Can I get rates for a single country only? | Yes. Enter the exact country name in the country field, and the Actor will return only that country's rates. |
| Is there a limit on how many rates I can scrape? | Free users get a 10-rate preview. Paid users can set maxItems up to 1,000,000 rates per run. |
| How do I filter by date? | Set the startDate field to the earliest effective date you want, in YYYY-MM-DD format. The Actor returns all rates from that date forward. |
| Can I schedule this Actor to run daily? | Yes. Use Apify's scheduler to run it every day with a startDate of the previous day, and you will collect each new rate as it is published. |
| Is this the same data as the Treasury's own website? | Yes. The Actor scrapes the public Treasury reporting pages directly, so the values match what you would see on the official site. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by U.S. Department of the Treasury. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `country` (type: `string`):

Filter by country name (exact match). Leave empty for all.

## `startDate` (type: `string`):

Earliest effective\_date (YYYY-MM-DD).

## `maxItems` (type: `integer`):

Free users limited to 10 exchange rates (preview). Paid users optional, up to 1,000,000.

## Actor input object example

```json
{
  "startDate": "2026-01-01",
  "maxItems": 10
}
```

# Actor output Schema

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

No description

# 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 = {
    "country": "",
    "startDate": "2026-01-01",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/treasury-exchange-rates-scraper").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 = {
    "country": "",
    "startDate": "2026-01-01",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/treasury-exchange-rates-scraper").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 '{
  "country": "",
  "startDate": "2026-01-01",
  "maxItems": 10
}' |
apify call parseforge/treasury-exchange-rates-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/treasury-exchange-rates-scraper"
        }
    }
}

```

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/J1roKzOwCu0awdJ4u/builds/LxZ8CYyIP0LJgvK3F/openapi.json
