How to Get Real-Time Lead - LME 3-month (LEAD3M) - Per Troy Ounce Prices with Metals-API

How to Get Real-Time Lead - LME 3-month (LEAD3M) - Per Troy Ounce Prices with Metals-API
Metals-API. We will explore the various features of the API, provide step-by-step instructions, and present example API calls to help you integrate this powerful tool into your applications.
Understanding Lead (XLE) in the Market
Metals-API Overview
Metals-API is a comprehensive JSON API that provides real-time and historical data on various metals, including Lead. It offers a range of endpoints that allow users to retrieve the latest rates, historical data, bid and ask prices, and much more. This API is designed for developers looking to integrate metal price data into their applications seamlessly.
Key Features of Metals-API
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data updated every 60 minutes or every 10 minutes. This allows you to stay up-to-date with the latest market prices for Lead and other metals.
- Historical Rates Endpoint: Access historical rates dating back to 2019. You can query the API for historical rates by appending a date to your request, enabling you to analyze past trends and make informed predictions.
- Bid and Ask Endpoint: Retrieve real-time bid and ask prices for Lead, providing insights into market liquidity and pricing dynamics.
- Convert Endpoint: This feature allows you to convert any amount from one metal to another or to/from USD, facilitating seamless transactions and calculations.
- Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, allowing for in-depth analysis of price movements over time.
- Fluctuation Endpoint: Track how Lead prices fluctuate on a day-to-day basis, providing insights into market volatility.
- Open/High/Low/Close (OHLC) Price Endpoint: Get the open, high, low, and close prices for Lead over a specified time period, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, enabling comprehensive market analysis.
- API Key: Your unique API key is required to access the API, ensuring secure and authorized usage.
- API Response: All exchange rates are delivered relative to USD, with detailed JSON responses that include timestamps and unit specifications.
- Supported Symbols Endpoint: Retrieve a constantly updated list of all available metal symbols, ensuring you have the latest information at your fingertips.
- News Endpoint: Stay informed with the latest news articles related to various metals, providing context and insights into market movements.
Accessing Real-Time Lead Prices
Step 1: Obtain Your API Key
Metals-API Website and obtain your unique API key. This key is essential for authenticating your requests.
Step 2: Make Your API Call
GET https://metals-api.com/api/latest?access_key=YOUR_API_KEY&base=USD&symbols=XLE
YOUR_API_KEY with your actual API key. This request will return the latest Lead prices in USD.
Step 3: Understanding the API Response
{
"success": true,
"timestamp": 1755748836,
"base": "USD",
"date": "2025-08-21",
"rates": {
"XLE": 0.000482
},
"unit": "per troy ounce"
}
rates object contains the current price of Lead (XLE) per troy ounce. The timestamp
indicates when the data was last updated, and the base
shows the currency used for the conversion.
Exploring Additional Endpoints
Historical Rates Endpoint
GET https://metals-api.com/api/historical?access_key=YOUR_API_KEY&date=YYYY-MM-DD&symbols=XLE
GET https://metals-api.com/api/historical?access_key=YOUR_API_KEY&date=2025-08-20&symbols=XLE
{
"success": true,
"timestamp": 1755662436,
"base": "USD",
"date": "2025-08-20",
"rates": {
"XLE": 0.000485
},
"unit": "per troy ounce"
}
Time-Series Endpoint
GET https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&start_date=YYYY-MM-DD&end_date=YYYY-MM-DD&symbols=XLE
GET https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&start_date=2025-08-14&end_date=2025-08-21&symbols=XLE
{
"success": true,
"timeseries": true,
"start_date": "2025-08-14",
"end_date": "2025-08-21",
"base": "USD",
"rates": {
"2025-08-14": {
"XLE": 0.000485
},
"2025-08-16": {
"XLE": 0.000483
},
"2025-08-21": {
"XLE": 0.000482
}
},
"unit": "per troy ounce"
}
Bid and Ask Endpoint
GET https://metals-api.com/api/bid-ask?access_key=YOUR_API_KEY&symbols=XLE
{
"success": true,
"timestamp": 1755748836,
"base": "USD",
"date": "2025-08-21",
"rates": {
"XLE": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}
Convert Endpoint
GET https://metals-api.com/api/convert?access_key=YOUR_API_KEY&from=XLE&to=USD&amount=1000
{
"success": true,
"query": {
"from": "XLE",
"to": "USD",
"amount": 1000
},
"info": {
"timestamp": 1755748836,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Common Use Cases for Metals-API
- Financial Applications: Integrate real-time Lead prices into trading platforms to enable users to make informed decisions based on the latest market data.
- Market Analysis Tools: Develop analytical tools that leverage historical data to identify trends and forecast future price movements.
- Investment Platforms: Provide investors with up-to-date information on Lead prices to assist in portfolio management and investment strategies.
- Research and Development: Use the API to gather data for academic research or industrial applications, analyzing the impact of Lead prices on various sectors.
Best Practices for Using Metals-API
- Rate Limiting: Be aware of your subscription plan's rate limits to avoid exceeding your quota. Implement caching strategies to minimize unnecessary API calls.
- Error Handling: Implement robust error handling to manage API response errors gracefully. This includes handling rate limit errors, invalid API keys, and network issues.
- Data Validation: Ensure that the data received from the API is validated before use, especially when performing calculations or displaying information to users.
- Security Considerations: Keep your API key secure and avoid exposing it in client-side code. Use server-side code to make API calls whenever possible.
Conclusion
Metals-API Documentation and explore the Metals-API Supported Symbols for a complete list of available metals.