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
All API endpoints return data in USD base. Forex rates represent how many units of the target currency equal 1 USD.

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.

Never expose your API key in client-side code. Use a server-side proxy to keep it secret.

Forex Rates

GET /api/forex

Returns latest exchange rates for 170+ currencies against USD, including crypto (BTC, ETH, LTC) and precious metals (XAU, XAG, XPT, XPD).

Headers

HeaderRequiredDescription
X-API-KeyYesYour 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

GET /api/crypto

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

GET /api/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:

CodeMeaning
200Success
401Unauthorized — invalid or missing API key
429Too Many Requests — daily limit exceeded
503Service 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):

PlanDaily LimitKeys
Free100 requests1
Pro ($9/mo)10,000 requests3
Business ($29/mo)100,000 requests10

When you approach your limit, the response includes headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 23
X-RateLimit-Reset: 1725321600

View all plans →