API Reference
Everything you need to integrate Roca Rates into your application
Overview
The Roca Rates API provides real-time exchange rates, cryptocurrency prices, and precious metals spot values through simple REST endpoints. All responses are JSON.
Base URL:
https://rates.rocasoftware.net/api
Authentication
Authenticate every request by including your API key in the X-API-Key header.
curl -H "X-API-Key: YOUR_API_KEY" \ https://rates.rocasoftware.net/api/forex
Get your API key from the dashboard. The free tier includes 100 requests per day — no credit card required.
Forex Rates
Returns latest exchange rates for 170+ currencies against USD, including crypto (BTC, ETH, LTC) and precious metals (XAU, XAG, XPT, XPD).
Headers
| Header | Required | Description |
|---|---|---|
X-API-Key | Yes | Your API key |
Response
{
"disclaimer": "...",
"license": "...",
"timestamp": 1725235200,
"base": "USD",
"rates": {
"EUR": 0.8636,
"GBP": 0.7412,
"JPY": 143.85,
"BTC": 0.0000130,
"ETH": 0.000418,
"XAU": 0.000392,
// ... 170+ currencies
}
}
Rates are cached for 1 hour. Crypto rates (BTC, ETH, LTC) are sourced from CoinLore and merged into the response.
Crypto Prices
Returns top 50 cryptocurrencies by market cap with prices, volume, and percentage changes. No authentication required.
Response
{
"data": [
{
"id": "90",
"symbol": "BTC",
"name": "Bitcoin",
"rank": 1,
"price_usd": "76782.40",
"market_cap_usd": "1520000000000",
"percent_change_24h": "2.35",
"percent_change_7d": "-1.20"
},
// ... 49 more coins
],
"info": { "coins_num": 50 }
}
Data updates every 5 minutes from CoinLore.
Precious Metals
Returns spot prices for Gold, Silver, Platinum, and Palladium in USD per troy ounce. No authentication required.
Response
{
"timestamp": 1725235200,
"metals": {
"XAU": { "name": "Gold", "oz": 2550.75 },
"XAG": { "name": "Silver", "oz": 29.45 },
"XPT": { "name": "Platinum", "oz": 962.30 },
"XPD": { "name": "Palladium", "oz": 1025.80 }
}
}
Error Handling
The API uses standard HTTP status codes:
| Code | Meaning |
|---|---|
200 | Success |
401 | Unauthorized — invalid or missing API key |
429 | Too Many Requests — daily limit exceeded |
503 | Service Unavailable — upstream data source error |
Error responses include a JSON body:
{
"error": "Unauthorized"
}
Rate Limits
Rate limits are applied per API key on a daily basis (resets at midnight UTC):
| Plan | Daily Limit | Keys |
|---|---|---|
| Free | 100 requests | 1 |
| Pro ($9/mo) | 10,000 requests | 3 |
| Business ($29/mo) | 100,000 requests | 10 |
When you approach your limit, the response includes headers:
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 23 X-RateLimit-Reset: 1725321600