How to programmatically get Tin - LME 3-month (TIN3M) prices using this API
Introduction
In the ever-evolving landscape of metal markets, the ability to programmatically access real-time data is crucial for developers and businesses alike. This blog post will delve into how to programmatically get Tin - LME 3-month (TIN3M) prices using the Metals-API. We will explore the innovative features of this API, its capabilities, and how it empowers developers to create next-generation applications that leverage real-time metals data.
About Tin (XSN)
Tin, represented by the symbol XSN, is a vital metal in various industries, including electronics, construction, and packaging. As the world moves towards digital transformation, the metal markets are also undergoing significant changes. Technological innovations and advancements in data analytics are reshaping how businesses interact with metal prices. The integration of smart technology into trading platforms allows for more informed decision-making, enabling businesses to respond swiftly to market fluctuations.
As we look to the future, the possibilities for Tin and other metals are vast. With the rise of electric vehicles and renewable energy technologies, the demand for Tin is expected to grow. Understanding the trends and insights provided by real-time data can help businesses position themselves strategically in the market.
API Description
The Metals-API is a powerful tool that provides access to real-time and historical metal prices, including Tin. This API is designed to facilitate the integration of metals data into applications, enabling developers to build solutions that can analyze trends, perform conversions, and track fluctuations. With its robust capabilities, the Metals-API is at the forefront of technological advancement in the metal markets.
By leveraging the Metals-API, developers can create applications that provide insights into market dynamics, helping businesses make data-driven decisions. The API supports various endpoints that cater to different needs, from retrieving the latest rates to accessing historical data dating back to 2008.
Key Features and Endpoints
The Metals-API offers a range of endpoints that provide comprehensive functionalities for developers. Here are some of the key features:
Latest Rates Endpoint
The Latest Rates Endpoint allows users to retrieve real-time exchange rate data for metals, updated based on the subscription plan. This endpoint is essential for applications that require up-to-the-minute pricing information. For instance, a trading application can utilize this endpoint to display current market prices for Tin and other metals, ensuring users have the latest information at their fingertips.
{
"success": true,
"timestamp": 1785283778,
"base": "USD",
"date": "2026-07-29",
"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"
}
Historical Rates Endpoint
Accessing historical rates is crucial for analyzing trends over time. The Historical Rates Endpoint allows users to query past exchange rates for most metals dating back to 2019. This feature is particularly useful for financial analysts and traders who need to assess market performance over specific periods.
{
"success": true,
"timestamp": 1785197378,
"base": "USD",
"date": "2026-07-28",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Bid And Ask Endpoint
The Bid and Ask Endpoint provides real-time bid and ask prices for metals, allowing traders to make informed decisions based on current market conditions. This endpoint is particularly beneficial for high-frequency trading applications where timing is critical.
{
"success": true,
"timestamp": 1785283778,
"base": "USD",
"date": "2026-07-29",
"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"
}
Convert Endpoint
The Convert Endpoint allows users to convert any amount from one metal to another or to/from USD. This feature is essential for applications that require currency conversion for pricing or trading purposes.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1785283778,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Time-Series Endpoint
The Time-Series Endpoint allows users to query the API for daily historical rates between two dates of their choice. This feature is particularly useful for analyzing price trends over specific periods, enabling businesses to make informed decisions based on historical data.
{
"success": true,
"timeseries": true,
"start_date": "2026-07-22",
"end_date": "2026-07-29",
"base": "USD",
"rates": {
"2026-07-22": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-07-24": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-07-29": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Fluctuation Endpoint
The Fluctuation Endpoint provides information about how metal prices fluctuate on a day-to-day basis. This feature is essential for traders who need to understand market volatility and make strategic decisions based on price changes.
{
"success": true,
"fluctuation": true,
"start_date": "2026-07-22",
"end_date": "2026-07-29",
"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"
}
Open/High/Low/Close (OHLC) Price Endpoint
The OHLC Price Endpoint allows users to retrieve the open, high, low, and close prices for a specific time period. This data is crucial for traders who analyze price movements and trends to make informed trading decisions.
{
"success": true,
"timestamp": 1785283778,
"base": "USD",
"date": "2026-07-29",
"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"
}
Historical LME Endpoint
The Historical LME Endpoint provides access to historical rates for LME symbols, dating back to 2008. This endpoint is particularly useful for businesses that require long-term data for analysis and forecasting.
{
"success": true,
"timestamp": 1785197378,
"base": "USD",
"date": "2026-07-28",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
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 metal data into their applications.
Conclusion
In conclusion, the Metals-API is a transformative tool that empowers developers to access real-time and historical data for metals, including Tin. With its extensive range of endpoints, the API facilitates the integration of metals data into applications, enabling businesses to make informed decisions based on accurate and timely information. As the metal markets continue to evolve, leveraging such innovative technologies will be crucial for staying competitive.
For more information on how to implement the Metals-API in your applications, visit the Metals-API Documentation. By understanding the capabilities of this API, developers can unlock the potential of real-time metals data and create applications that drive efficiency and insight in the metal markets.