1 Getting Started
The MetalMarket API is free to use and requires no authentication for basic endpoints. Simply make HTTP GET requests to our API base URL:
All responses are in JSON format with UTF-8 encoding. The API supports CORS for browser-based applications.
https://metalmarket.cash/api/v1/All responses are in JSON format with UTF-8 encoding. The API supports CORS for browser-based applications.
2 Endpoints Reference
GET /api/v1/prices
Returns current prices for all tracked metals.
GET /api/v1/prices/{metal_id}
Returns detailed price data for a specific metal. Supported IDs: copper, aluminum, zinc, nickel, tin, lead, gold, silver, platinum, palladium.
GET /api/v1/prices/{metal_id}/history?days=30
Returns hourly price history for sparkline charts. Maximum 365 days.
GET /api/v1/calculator?metal_id=copper&weight_kg=100&purity=95
Calculates scrap metal value based on current market prices.
GET /api/v1/market-status
Returns whether the LME market is currently open.
Returns current prices for all tracked metals.
{\n "copper": {\n "id": "copper",\n "symbol": "CU",\n "price": 8945.50,\n "unit": "USD/t",\n "change": 42.30,\n "change_pct": 0.47,\n "high_24h": 8980.00,\n "low_24h": 8890.00\n },\n ...\n}GET /api/v1/prices/{metal_id}
Returns detailed price data for a specific metal. Supported IDs: copper, aluminum, zinc, nickel, tin, lead, gold, silver, platinum, palladium.
GET /api/v1/prices/{metal_id}/history?days=30
Returns hourly price history for sparkline charts. Maximum 365 days.
GET /api/v1/calculator?metal_id=copper&weight_kg=100&purity=95
Calculates scrap metal value based on current market prices.
GET /api/v1/market-status
Returns whether the LME market is currently open.
3 Rate Limits & Best Practices
- Rate Limit: 100 requests per minute per IP address
- Cache prices for at least 60 seconds to reduce load
- Use ETags and conditional requests for efficient polling
- Implement exponential backoff for retry logic on errors
- Prefer /api/v1/prices (single request) over individual metal endpoints when you need multiple metals
4 Code Examples
JavaScript (Fetch):
Python (requests):
cURL:
const response = await fetch(\n 'https://metalmarket.cash/api/v1/prices'\n);\nconst prices = await response.json();\nconsole.log(prices.gold.price);Python (requests):
import requests\n\nprices = requests.get(\n 'https://metalmarket.cash/api/v1/prices'\n).json()\nprint(f\"Gold: ${prices['gold']['price']}\")cURL:
curl -s https://metalmarket.cash/api/v1/prices | jq .gold 5 Webhook & Real-Time Options
For real-time price alerts and webhook integrations, we offer premium API plans:
- WebSocket Feed: Sub-second price updates for all metals
- Webhook Alerts: HTTP POST notifications when prices cross your thresholds
- Historical Data: Up to 10 years of daily price data
- Higher Rate Limits: Up to 10,000 requests/minute
6 Support & Community
Need help integrating our API? Here are your options:
- API Documentation: Full OpenAPI/Swagger spec at /api/docs
- GitHub: Open-source SDK libraries for Python, JavaScript, and PHP
- Community Forum: Connect with other developers using MetalMarket data
- Email Support: api@metalmarket.cash for integration questions