Retrieve Thai Baht (THB) prices via this API
Retrieve Thai Baht (THB) Prices via Metals-API
The Thai Baht (THB) is a significant currency in Southeast Asia, reflecting the economic landscape of Thailand and its trading relationships. In today's digital age, the ability to retrieve real-time exchange rates and historical data for THB is crucial for developers and businesses alike. This is where the Metals-API comes into play, offering a robust platform for accessing metal prices and currency conversion data, including THB. This blog post will delve into the capabilities of the Metals-API, exploring its innovative features, endpoints, and how it can empower developers to create next-generation applications.
About Thai Baht (THB)
The Thai Baht is not just a currency; it is a reflection of Thailand's economic vitality and its integration into the global market. As digital transformation sweeps across industries, the metal markets are also evolving. The integration of technological innovations, data analytics, and smart technology is reshaping how traders and businesses interact with currency data. The Metals-API stands at the forefront of this transformation, providing developers with the tools they need to harness real-time data for informed decision-making.
With the rise of data analytics, businesses can gain insights into market trends and fluctuations. The Metals-API offers a comprehensive suite of features that allow for deep analysis of currency movements, including the Thai Baht. By leveraging this API, developers can create applications that not only track current prices but also analyze historical trends, providing a competitive edge in the market.
API Description
The Metals-API is a powerful tool designed for developers looking to access real-time and historical data on metal prices and currency conversions. Its capabilities extend beyond simple data retrieval; it empowers developers to build applications that can analyze trends, forecast prices, and provide insights into market dynamics. The API is designed with innovation in mind, allowing for seamless integration into various applications.
For detailed information on how to implement the API, developers can refer to the Metals-API Documentation, which provides comprehensive guidance on using the API effectively. The documentation covers everything from authentication to endpoint usage, ensuring that developers have all the information they need to get started.
Key Features and Endpoints
The Metals-API offers a variety of endpoints that cater to different needs. Each endpoint is designed to provide specific functionalities that can be leveraged in various applications. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data for THB and other currencies. Depending on the subscription plan, updates can occur every 60 minutes or every 10 minutes, ensuring that users have access to the most current data.
- Historical Rates Endpoint: Developers can access historical exchange rates dating back to 2019. By appending a specific date to the API request, users can retrieve past rates, which is essential for trend analysis and forecasting.
- Bid and Ask Endpoint: This feature allows users to retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing strategies.
- Convert Endpoint: The conversion endpoint enables users to convert amounts from one currency to another, including THB. This is particularly useful for businesses operating in multiple currencies.
- Time-Series Endpoint: Users can query the API for daily historical rates between two dates, allowing for in-depth analysis of price movements over time.
- Fluctuation Endpoint: This endpoint provides information on how currencies fluctuate on a day-to-day basis, helping users understand market volatility.
- Carat Endpoint: Users can retrieve information about gold rates by carat, which is essential for jewelers and investors in precious metals.
- Lowest/Highest Price Endpoint: This feature allows users to query the API for the lowest and highest prices of metals over a specified period.
- Open/High/Low/Close (OHLC) Price Endpoint: Users can access OHLC data for specific time periods, which is crucial for traders looking to analyze market trends.
- Historical LME Endpoint: This endpoint provides access to historical rates for LME symbols dating back to 2008, offering valuable insights for traders in the metals market.
- API Key: Each user is provided with a unique API key that must be included in requests to authenticate access to the API.
- API Response: The API delivers exchange rates relative to USD by default, with all data returned in a structured JSON format.
- Available Endpoints: The Metals-API includes 14 different endpoints, each designed to provide unique functionalities for users.
- Supported Symbols Endpoint: This endpoint returns a constantly updated list of all available currencies, including THB, ensuring users have access to the latest information.
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.
API Endpoint Examples and Responses
Understanding how to interpret the API responses is crucial for effective implementation. Here are examples of various endpoints and their JSON responses:
Latest Rates Endpoint
Get real-time exchange rates for all available metals:
{
"success": true,
"timestamp": 1782778293,
"base": "USD",
"date": "2026-06-30",
"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
Access historical exchange rates for any date since 1999:
{
"success": true,
"timestamp": 1782691893,
"base": "USD",
"date": "2026-06-29",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-series Endpoint
Get exchange rates for a specific time period:
{
"success": true,
"timeseries": true,
"start_date": "2026-06-23",
"end_date": "2026-06-30",
"base": "USD",
"rates": {
"2026-06-23": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-06-25": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-06-30": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
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": 1782778293,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates:
{
"success": true,
"fluctuation": true,
"start_date": "2026-06-23",
"end_date": "2026-06-30",
"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"
}
OHLC (Open/High/Low/Close) Endpoint
Get OHLC data for a specific time period:
{
"success": true,
"timestamp": 1782778293,
"base": "USD",
"date": "2026-06-30",
"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"
}
Bid/Ask Endpoint
Get current bid and ask prices for metals:
{
"success": true,
"timestamp": 1782778293,
"base": "USD",
"date": "2026-06-30",
"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"
}
Conclusion
The Thai Baht (THB) plays a crucial role in the financial landscape of Southeast Asia, and the ability to access real-time and historical data through the Metals-API is invaluable for developers and businesses. By leveraging the innovative features of the Metals-API, developers can create applications that not only track currency movements but also analyze trends and provide insights into market dynamics.
With endpoints designed for various functionalities, including real-time rates, historical data, and conversion capabilities, the Metals-API empowers developers to build sophisticated applications that meet the demands of the modern financial landscape. For more information on how to get started, visit the Metals-API Website and explore the Metals-API Documentation for detailed guidance.
As the market continues to evolve, staying informed and utilizing advanced tools like the Metals-API will be essential for success in the competitive world of finance. Embrace the future of currency data and unlock the potential of the Thai Baht with the Metals-API.