x-rates APIx-rates.com ↗
Access current and historical exchange rates, currency conversion, monthly averages, and 24-hour trend data from x-rates.com via a structured JSON API.
What is the x-rates API?
This API exposes 7 endpoints covering current exchange rates, historical snapshots, currency conversion, monthly averages, and trend data sourced from x-rates.com. The get_current_rates_table endpoint returns rate and inverse_rate for every supported currency pair against a chosen base currency, while get_24h_percent_changes surfaces direction and magnitude of moves for major pairs over the last 24 hours.
curl -X GET 'https://api.parse.bot/scraper/8c172966-02db-4c7c-9e9f-4c9e3f6a8be9/get_current_rates_table?from=USD&amount=1' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace x-rates-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""XRates API — currency exchange rates, conversion, and trend data."""
from parse_apis.xrates_api import XRates, From, CurrencyNotFound
client = XRates()
# List all supported currencies
currencies = client.currencylists.get()
print(f"Supported currencies: {currencies.count}")
for c in currencies.currencies[:3]:
print(f" {c.code}: {c.name}")
# Get current exchange rates for USD using the From enum
table = client.ratestables.current(from_currency=From.USD)
print(f"\nRates from {table.base_currency} (as of {table.timestamp}):")
for rate in table.rates[:3]:
print(f" {rate.code}: {rate.rate} (inverse: {rate.inverse_rate})")
# Convert currency
conversion = client.conversions.convert(from_currency=From.USD, to_currency=From.EUR, amount=1000)
print(f"\n{conversion.amount} {conversion.from_currency} = {conversion.converted_value} {conversion.to_currency}")
print(f" Result text: {conversion.result_text}")
# Get historical rates for a past date
historical = client.ratestables.historical(date="2024-06-01", from_currency=From.EUR)
print(f"\nHistorical rates on 2024-06-01 from {historical.base_currency}:")
for rate in historical.rates[:3]:
print(f" {rate.code}: {rate.rate}")
# Monthly averages for a currency pair
averages = client.monthlyaverageresults.get(from_currency=From.USD, to_currency=From.GBP, year="2024")
print(f"\nMonthly USD→GBP averages for {averages.year}:")
for avg in averages.monthly_averages[:3]:
print(f" {avg.month}: {avg.average_rate} ({avg.days})")
# Graph trend data
graph = client.graphresults.get(from_currency=From.USD, to_currency=From.JPY)
print(f"\nUSD→JPY trend ({graph.from_currency}→{graph.to_currency}):")
for dp in graph.data_points[:3]:
print(f" {dp.label}: {dp.rate}")
# 24-hour market trends
snapshot = client.trendsnapshots.get()
print(f"\n24h trends (as of {snapshot.timestamp}):")
for trend in snapshot.trends[:3]:
print(f" {trend.pair}: {trend.change} ({trend.direction})")
# Error handling — catch not-found for invalid currency
try:
client.conversions.convert(from_currency="INVALID", to_currency=From.EUR)
except CurrencyNotFound as exc:
print(f"\nCurrency not found: {exc}")
print("\nExercised: currencylists.get / ratestables.current / ratestables.historical / conversions.convert / monthlyaverageresults.get / graphresults.get / trendsnapshots.get")
Fetches the current exchange rates table for a given base currency against all other supported currencies. Returns rate and inverse rate for each currency pair. The table includes ~50 currencies. Rates update multiple times daily.
| Param | Type | Description |
|---|---|---|
| from | string | Base currency code (e.g. USD, EUR, GBP). |
| amount | number | Amount to calculate rates for. |
{
"type": "object",
"fields": {
"rates": "array of objects with currency, code, rate, and inverse_rate",
"amount": "number, the amount used for calculation",
"timestamp": "string or null, UTC timestamp of rates",
"base_currency": "string, the base currency code"
},
"sample": {
"data": {
"rates": [
{
"code": "EUR",
"rate": 0.865935,
"currency": "Euro",
"inverse_rate": 1.154821
},
{
"code": "GBP",
"rate": 0.74744,
"currency": "British Pound",
"inverse_rate": 1.3379
}
],
"amount": 1,
"timestamp": "Jun 11, 2026 02:34 UTC",
"base_currency": "USD"
},
"status": "success"
}
}About the x-rates API
Current and Historical Rate Tables
get_current_rates_table accepts a from base currency code (e.g. USD, EUR, GBP) and an optional amount, returning an array of objects each containing currency, code, rate, and inverse_rate, along with a UTC timestamp and the base_currency used. get_historical_rates_table mirrors this structure but requires a date parameter in YYYY-MM-DD format, making it straightforward to reconstruct the rate environment on any past date supported by x-rates.com.
Conversion and Averages
convert_currency takes from, to, and an optional amount and returns both a numeric converted_value and a result_text string (e.g. '85.389017EUR'). get_monthly_average accepts a currency pair and an optional year (defaults to the current year), returning a monthly_averages array where each entry includes month, average_rate, and days — useful for period-over-period analysis without needing to aggregate daily snapshots yourself.
Trend Data and 24-Hour Changes
get_graph_data returns data_points for the current year, each with a label (month abbreviation) and a rate, giving a year-to-date picture of a currency pair's movement. get_24h_percent_changes requires no inputs and delivers a trends array with pair, change, and direction for major pairs, plus a UTC timestamp. get_supported_currencies returns the complete list of currency names and codes with a total count.
The x-rates API is a managed, monitored endpoint for x-rates.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when x-rates.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official x-rates.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display a live multi-currency rate card using
get_current_rates_tablewith a user-selected base currency - Back-fill historical portfolio valuations by querying
get_historical_rates_tablefor specific past dates - Build a currency converter widget using
convert_currencywithfrom,to, andamountinputs - Generate monthly exchange rate trend charts using
get_monthly_averagedata across multiple years - Show year-to-date rate movement graphs by plotting
data_pointsfromget_graph_data - Alert users to significant FX moves by monitoring
changeanddirectionfromget_24h_percent_changes - Populate a currency selector dropdown by fetching the full list from
get_supported_currencies
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does x-rates.com have an official developer API?+
What does `get_monthly_average` return, and does it cover multiple years in a single call?+
monthly_averages array for one currency pair and one year at a time. Each entry includes month, average_rate, and days. To compare across years you need to make one call per year using the year parameter in YYYY format.Does the API expose tick-level or intraday rate data?+
How current is the `timestamp` returned by the rate endpoints?+
timestamp field reflects the UTC time of the rate snapshot as reported by x-rates.com. It can be null if no timestamp is present in the source data for that request. The site updates rates periodically rather than in real time, so the timestamp may lag the true market rate by some minutes.Does the API support currency cross-rates not involving USD as a base?+
get_current_rates_table and get_historical_rates_table accept any supported currency in the from parameter, not just USD. You can retrieve a list of all valid codes with get_supported_currencies. Cross-rate accuracy depends on what x-rates.com publishes for that base currency.