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

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.

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

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

GET /v1/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-Key or Authorization: BearerYesYour 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 /v1/crypto

Returns top 50 cryptocurrencies by market cap with prices, volume, and percentage changes.

Headers

HeaderRequiredDescription
X-API-Key or Authorization: BearerYesYour 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

GET /v1/metals

Returns spot prices for Gold, Silver, Platinum, and Palladium in USD per troy ounce.

Headers

HeaderRequiredDescription
X-API-Key or Authorization: BearerYesYour 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:

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 →