Fetch LBMA Platinum Am (LBXPTAM) Historical Prices with Metals-API Integration

Introduction
In the world of precious metals, platinum holds a unique position due to its rarity and diverse applications. As industries increasingly turn towards sustainable innovation and green technology, the demand for platinum continues to rise. For developers and businesses looking to track the historical prices of platinum, the Metals-API offers a powerful solution. This blog post will delve into how to fetch LBMA Platinum Am (LBXPTAM) historical prices using the Metals-API, exploring its capabilities, endpoints, and practical applications in real-time data integration.
Metals-API Information
About Platinum (XPT)
Platinum, represented by the symbol XPT, is not only a precious metal but also a critical component in various green technologies. Its applications range from catalytic converters in vehicles to electronics and jewelry. As the world shifts towards clean energy solutions, platinum's role in hydrogen fuel cells and other sustainable technologies becomes increasingly significant. The integration of smart technology in industries also highlights the need for accurate and real-time data on platinum prices, making APIs like Metals-API essential for developers.
With the rise of digital transformation, the ability to access historical and real-time data on platinum prices empowers developers to create applications that can analyze market trends, forecast prices, and make informed decisions. The Metals-API provides a robust platform for accessing this data, enabling businesses to harness the power of information in their operations.
API Description
The Metals-API is a comprehensive JSON API that provides real-time and historical data on various metals, including platinum. It is designed to empower developers to build next-generation applications that require accurate and timely metals data. The API's capabilities include fetching the latest rates, historical prices, and even fluctuations over time, making it a versatile tool for any developer working with precious metals.
One of the standout features of the Metals-API is its ability to deliver data with high precision and reliability. By utilizing this API, developers can integrate real-time metals data into their applications, enhancing their functionality and providing users with valuable insights. The API supports a wide range of endpoints, each tailored to meet specific data needs, from the latest rates to historical trends.
Key Features and Endpoints
The Metals-API offers several key features that developers can leverage to access and manipulate metals data effectively:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint provides real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This feature is crucial for applications that require up-to-the-minute pricing information.
- Historical Rates Endpoint: Historical rates are available for most currencies dating back to 2019. Developers can query the Metals-API for historical rates by appending a specific date to the request. This endpoint is particularly useful for analyzing price trends over time.
- Bid and Ask Endpoint: This powerful feature allows developers to retrieve real-time bid and ask prices for metals, providing insights into market dynamics and helping users make informed trading decisions.
- Convert Endpoint: The Metals-API includes a currency conversion endpoint, enabling users to convert any amount from one metal to another or to/from USD. This functionality is essential for applications that require multi-currency support.
- Time-Series Endpoint: This endpoint allows developers to query the API for daily historical rates between two dates of their choice, facilitating in-depth analysis of price movements over time.
- Fluctuation Endpoint: Using this endpoint, developers can retrieve information about how metal prices fluctuate on a day-to-day basis, providing valuable insights into market volatility.
- Carat Endpoint: This feature allows users to retrieve information about gold rates by carat, which is particularly useful for jewelers and retailers.
- Lowest/Highest Price Endpoint: Developers can query the API to get the lowest and highest price for a specified date, aiding in market analysis and decision-making.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, essential for traders looking to analyze market performance.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, allowing for comprehensive analysis of market trends.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate and authorize access to the API.
- API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency and ease of use for developers.
- Available Endpoints: The API comes with numerous endpoints, each providing different functionalities tailored to various data needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies and metals, allowing developers to stay updated on the latest symbols.
- Gold Price India Endpoint: Retrieve the latest gold price in India using this dedicated endpoint, which is particularly useful for regional applications.
- News Endpoint: The Metals-API also provides access to the latest news articles related to various metals, keeping users informed about market developments.
List of Symbols
The Metals-API provides access to a comprehensive range of metal symbols. For a complete list of all supported symbols and their specifications, refer to the Metals-API Supported Symbols page. This resource is invaluable for developers looking to integrate specific metals into their applications.
API Endpoint Examples and Responses
Understanding the API responses is crucial for effective integration. Below are examples of various endpoints and their corresponding JSON responses:
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1744762046,
"base": "USD",
"date": "2025-04-16",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744,
"XCU": 0.294118,
"XAL": 0.434783,
"XNI": 0.142857,
"XZN": 0.344828
},
"unit": "per troy ounce"
}
In this response, the rates
object contains the current prices of various metals, including platinum (XPT), which is essential for developers tracking market conditions.
Historical Rates Endpoint
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1744675646,
"base": "USD",
"date": "2025-04-15",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This response provides historical pricing data, allowing developers to analyze trends and make informed decisions based on past performance.
Time-series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2025-04-09",
"end_date": "2025-04-16",
"base": "USD",
"rates": {
"2025-04-09": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2025-04-11": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2025-04-16": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This endpoint is particularly useful for developers looking to visualize price trends over a specified period, enabling better forecasting and analysis.
Convert Endpoint
Convert any amount from one metal to another or to/from USD:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1744762046,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This response shows how the conversion functionality works, allowing developers to integrate currency conversion seamlessly into their applications.
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2025-04-09",
"end_date": "2025-04-16",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
},
"XAG": {
"start_rate": 0.03825,
"end_rate": 0.03815,
"change": -0.0001,
"change_pct": -0.26
},
"XPT": {
"start_rate": 0.000915,
"end_rate": 0.000912,
"change": -3.0e-6,
"change_pct": -0.33
}
},
"unit": "per troy ounce"
}
This endpoint provides insights into market volatility, which is crucial for traders and analysts looking to understand price movements.
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1744762046,
"base": "USD",
"date": "2025-04-16",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
},
"XAG": {
"open": 0.03825,
"high": 0.0383,
"low": 0.0381,
"close": 0.03815
},
"XPT": {
"open": 0.000915,
"high": 0.000918,
"low": 0.00091,
"close": 0.000912
}
},
"unit": "per troy ounce"
}
This endpoint is essential for traders who need to analyze market performance over specific periods, providing a comprehensive view of price movements.
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1744762046,
"base": "USD",
"date": "2025-04-16",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
},
"XAG": {
"bid": 0.0381,
"ask": 0.0382,
"spread": 0.0001
},
"XPT": {
"bid": 0.000911,
"ask": 0.000913,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}
This response provides critical information for traders, allowing them to understand the current market conditions and make informed decisions.
Conclusion
The Metals-API is an invaluable resource for developers looking to integrate real-time and historical data on platinum and other precious metals into their applications. By leveraging the various endpoints available, developers can create powerful tools that analyze market trends, forecast prices, and provide users with essential insights into the metals market.
As industries continue to embrace green technology and sustainable innovation, the demand for accurate metals data will only grow. The Metals-API stands at the forefront of this transformation, offering a comprehensive solution for accessing and utilizing precious metals data effectively. For more information on how to get started, visit the Metals-API Documentation and explore the possibilities of integrating this powerful API into your projects.