API Reference
Everything you need to integrate Roca Rates into your application
Overview
The Roca Rates API provides exchange rates, cryptocurrency prices, and precious metals spot values through simple REST endpoints. All responses are JSON.
Authenticated API base URL:
https://apixrates.rocasoftware.net/v1
Public website-data base URL:
https://apixrates.rocasoftware.net/public
Authentication
Every endpoint under /v1 requires an API key. Send it in X-API-Key or as Authorization: Bearer YOUR_API_KEY. API keys in URL query parameters are not accepted.
curl -H "X-API-Key: YOUR_API_KEY" \ https://apixrates.rocasoftware.net/v1/forex
Get your API key from the dashboard. The free tier includes 100 requests per day — no credit card required.
Public website-data endpoints
The public pages use /public/forex, /public/crypto, and /public/metals. These routes are cached and protected against abusive traffic (120 requests per IP per minute); applications should integrate with authenticated /v1 routes.
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 or Authorization: Bearer | 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.
Headers
| Header | Required | Description |
|---|---|---|
X-API-Key or Authorization: Bearer | Yes | Your API key |
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.
Headers
| Header | Required | Description |
|---|---|---|
X-API-Key or Authorization: Bearer | Yes | Your API key |
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