Query Historical Data for Vijayawada Gold 24k (VIJA-24k) through this API
Query Historical Data for Vijayawada Gold 24k (VIJA-24k) through this API
In the ever-evolving landscape of precious metals trading, the ability to access historical data is paramount for investors, traders, and developers alike. This is particularly true for gold, represented by the symbol XAU. The Metals-API provides a robust framework for querying historical prices, enabling users to make informed decisions based on comprehensive market insights. In this blog post, we will delve into the capabilities of the Metals-API, focusing on how to effectively retrieve historical data for gold, particularly for the Vijayawada market.
About Gold (XAU)
Gold has long been a symbol of wealth and stability, serving as a hedge against inflation and economic uncertainty. In recent years, the digital transformation of the precious metals market has revolutionized how investors interact with gold. The integration of data analytics and technology into trading practices has opened new avenues for price discovery and market insights. With the rise of digital asset solutions, gold trading is no longer confined to traditional methods; it has evolved into a dynamic ecosystem where real-time data plays a crucial role.
The Metals-API stands at the forefront of this transformation, providing developers with the tools necessary to build next-generation applications that leverage real-time metals data. By utilizing the API, users can access a wealth of information, including historical prices, market fluctuations, and conversion rates, all of which are essential for making informed trading decisions.
API Description
The Metals-API is designed to empower developers by offering a comprehensive suite of features that facilitate seamless integration of metals data into applications. With a focus on innovation and technological advancement, the API enables users to access real-time and historical data for various metals, including gold, silver, platinum, and palladium.
One of the standout features of the Metals-API is its ability to provide historical rates dating back to 2019. This is particularly valuable for traders and analysts who require extensive data for trend analysis and forecasting. The API's endpoints are designed to cater to a variety of use cases, from simple price queries to complex data analysis.
Key Features and Endpoints
The Metals-API offers a range of endpoints that allow users to access different types of data. Here are some of the key features:
- Latest Rates Endpoint: Depending on your subscription plan, this endpoint returns real-time exchange rate data updated every 60 minutes, every 10 minutes, or even more frequently. This is crucial for traders who need to stay updated on market movements.
- Historical Rates Endpoint: Users can query historical rates by appending a specific date to the API request. This feature is essential for analyzing past market trends and making predictions based on historical performance.
- Bid and Ask Endpoint: This powerful feature allows users to retrieve real-time bid and ask prices for metals, providing insights into market liquidity and pricing dynamics.
- 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 is particularly useful for traders dealing in multiple currencies.
- Time-Series Endpoint: This endpoint allows users to query daily historical rates between two dates of their choice, facilitating in-depth analysis of price movements over time.
- Fluctuation Endpoint: Users can track how metal prices fluctuate on a day-to-day basis, which is vital for understanding market volatility.
- Carat Endpoint: This feature provides information about gold rates by carat, allowing users to make precise calculations based on the purity of gold.
- Lowest/Highest Price Endpoint: Users can query the API to get the lowest and highest prices for a specified date, which is essential for identifying market extremes.
- Open/High/Low/Close (OHLC) Price Endpoint: This endpoint provides open, high, low, and close prices for a specific date, offering a comprehensive view of market performance.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, which is beneficial for users interested in long-term trends.
- API Key: Each user is assigned a unique API key that must be included in requests to authenticate access to the API.
- API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency across data retrieval.
- Available Endpoints: The API features 14 endpoints, each providing different functionalities tailored to various user needs.
- Supported Symbols Endpoint: This endpoint returns all available currencies, ensuring users have access to the latest information.
- News Endpoint: Retrieve 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.
API Endpoint Examples and Responses
Understanding the API responses is crucial for effective implementation. Below are examples of various endpoints and their corresponding JSON responses:
Latest Rates Endpoint
{
"success": true,
"timestamp": 1767831628,
"base": "USD",
"date": "2026-01-08",
"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"
}
This response indicates the latest exchange rates for various metals, with gold (XAU) priced at 0.000482 per troy ounce.
Historical Rates Endpoint
{
"success": true,
"timestamp": 1767745228,
"base": "USD",
"date": "2026-01-07",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
This example shows historical rates for a specific date, allowing users to analyze past performance.
Time-series Endpoint
{
"success": true,
"timeseries": true,
"start_date": "2026-01-01",
"end_date": "2026-01-08",
"base": "USD",
"rates": {
"2026-01-01": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-01-03": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-01-08": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
This response provides daily historical rates for a specified period, enabling users to track price movements over time.
Convert Endpoint
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1767831628,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
This example illustrates how to convert an amount from USD to gold (XAU), providing the resulting value in troy ounces.
Fluctuation Endpoint
{
"success": true,
"fluctuation": true,
"start_date": "2026-01-01",
"end_date": "2026-01-08",
"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 response shows how metal prices fluctuate over a specified period, providing insights into market volatility.
OHLC (Open/High/Low/Close) Endpoint
{
"success": true,
"timestamp": 1767831628,
"base": "USD",
"date": "2026-01-08",
"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 provides a comprehensive view of market performance for a specific date, detailing the open, high, low, and close prices.
Bid/Ask Endpoint
{
"success": true,
"timestamp": 1767831628,
"base": "USD",
"date": "2026-01-08",
"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 current bid and ask prices for metals, essential for understanding market liquidity.
Conclusion
In conclusion, the Metals-API serves as a powerful tool for accessing historical data for gold and other precious metals. By leveraging its various endpoints, developers can create applications that provide real-time insights and analytics, enhancing trading strategies and decision-making processes. The ability to query historical prices, track fluctuations, and convert between currencies empowers users to navigate the complexities of the metals market with confidence.
For more detailed information on how to implement these features, refer to the Metals-API Documentation. Additionally, to explore the full range of supported symbols, visit the Metals-API Supported Symbols page. By utilizing the Metals-API, you can unlock the potential of historical data and enhance your trading capabilities in the precious metals market.