Rates API
JSON · CORS enabledReference FX, crypto and precious-metal data as JSON, with a 30-second server-side cache. Anonymous use is rate-limited per IP; an API key lifts the limit and gives you per-key usage stats.
Authentication
Anonymous requests work without a key and are limited to 60 requests / minute per IP. Send a key either as the key query parameter or the X-API-Key header. Keys are created in the admin panel (Currency → API keys) and can be revoked at any time.
Default key limits: 60 / minute and 2,000 / day by default (configurable per key). Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Plan.
Errors
Invalid or disabled key → 403 with {"ok":false,"error":"invalid or disabled api key"}. Limit exceeded → 429 with Retry-After, retry_after in the body and the docs link. Unknown endpoint returns 200 with {"ok":false,"error":"unknown endpoint"} — check the path.
Rates and prices are indicative reference values, not tradeable quotes. Attribution is required for substantial extracts.
FX endpoints
| Endpoint | Returns |
|---|---|
?rates-api-type-latest | All USD-based reference rates, provider, data date and update time. |
?rates-api-type-convert&from=USD&to=CNY&amount=1000 | Cross rate and converted amount. |
?rates-api-type-history&from=USD&to=CNY | Daily series for 7d / 30d / 90d / 1y. |
?rates-api-type-currencies | Currency list with code, name, symbol and current rate. |
?rates-api-type-pairs | Popular pairs with rates and links. |
Metals endpoints
| Endpoint | Returns |
|---|---|
?rates-api-type-metals | Gold and silver spot in USD: per troy ounce, gram and kilo, previous close and daily change. |
?rates-api-type-metals&code=CNY | Same, plus local-currency per-ounce / per-gram / per-kilo prices. |
Spot feed: gold-api.com (XAU / XAG), refreshed every five minutes; daily closes are stored from launch. Local prices = USD spot × the site reference FX rate and exclude duty, VAT and dealer premiums.
Crypto endpoints
| Endpoint | Returns |
|---|---|
?crypto-api-type-latest | All tracked coins with price, 24h change, market cap. |
?crypto-api-type-coin&symbol=BTC | Single coin quote and details. |
?crypto-api-type-history&symbol=BTC&range=1y | Daily candles including volume. |
?crypto-api-type-convert&from=BTC&to=CNY&amount=1 | Crypto → fiat conversion. |
?crypto-api-type-list | Coin list with symbols and names. |
All endpoints support nocache=1 for debugging. CORS is open; a browser fetch works without extra headers.