The Easiest Way to Get Solana (SOL) Historical Rates for API Integration
The Easiest Way to Get Solana (SOL) Historical Rates for API Integration
In the rapidly evolving world of digital assets, accessing accurate historical rates for cryptocurrencies like Solana (SOL) is crucial for developers and analysts alike. One of the most effective ways to obtain this data is through the Metals-API, a robust platform designed to provide real-time and historical data for various metals and currencies. This blog post will guide you through the process of retrieving historical prices for Solana using the Metals-API, including detailed explanations of endpoints, parameters, and data formats.
Understanding Metals-API
The Metals-API is a powerful tool that allows developers to access real-time and historical data for metals and currencies. It is particularly useful for those looking to integrate financial data into their applications, enabling them to build next-generation solutions that leverage accurate and timely information. The API supports a wide range of functionalities, including retrieving the latest rates, historical data, and even performing currency conversions.
API Description
The Metals-API is designed with innovation and technological advancement in mind. It empowers developers to create applications that can analyze market trends, perform data analytics, and integrate smart technologies. By providing real-time metals data, the API transforms how businesses and developers interact with financial information, paving the way for future trends and possibilities in the digital asset space.
For more detailed information, you can refer to the Metals-API Documentation, which outlines all available endpoints and their functionalities.
Key Features of Metals-API
The Metals-API offers a variety of endpoints that cater to different needs. Here are some of the key features:
- Latest Rates Endpoint: This endpoint provides real-time exchange rate data, updated based on your subscription plan. Depending on your plan, you can receive updates every 60 minutes or even every 10 minutes.
- Historical Rates Endpoint: Access historical rates dating back to 2019. You can query the API for specific dates to retrieve past rates.
- Bid and Ask Endpoint: This feature allows you to retrieve real-time bid and ask prices for various metals, providing insights into market dynamics.
- Convert Endpoint: Easily convert amounts from one currency to another, including conversions to and from USD.
- 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 currencies fluctuate on a day-to-day basis, providing insights into market volatility.
- Open/High/Low/Close (OHLC) Price Endpoint: Retrieve open, high, low, and close prices for specific time periods, essential for technical analysis.
- Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, offering a comprehensive view of metal prices.
- API Key: Your unique API key is required for authentication and must be included in your requests.
- API Response: The API delivers exchange rates relative to USD by default, ensuring consistency in your data.
- Supported Symbols Endpoint: Get a constantly updated list of all available currencies and metals supported by the API.
- News Endpoint: Retrieve the latest news articles related to various metals, keeping you informed about market trends.
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 how to interact with the Metals-API is crucial for effective integration. Below are examples of various endpoints, including their expected responses.
Latest Rates Endpoint
To get real-time exchange rates for all available metals, you can use the following endpoint:
GET /latest
Example response:
{
"success": true,
"timestamp": 1772251753,
"base": "USD",
"date": "2026-02-28",
"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 with this endpoint:
GET /historical/YYYY-MM-DD
Example response:
{
"success": true,
"timestamp": 1772165353,
"base": "USD",
"date": "2026-02-27",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
Time-Series Endpoint
To get exchange rates for a specific time period, use the time-series endpoint:
GET /timeseries?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Example response:
{
"success": true,
"timeseries": true,
"start_date": "2026-02-21",
"end_date": "2026-02-28",
"base": "USD",
"rates": {
"2026-02-21": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-02-23": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-02-28": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
Convert Endpoint
To convert any amount from one metal to another or to/from USD, use the convert endpoint:
GET /convert?from=USD&to=XAU&amount=1000
Example response:
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1772251753,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Fluctuation Endpoint
Track rate fluctuations between two dates using the fluctuation endpoint:
GET /fluctuation?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Example response:
{
"success": true,
"fluctuation": true,
"start_date": "2026-02-21",
"end_date": "2026-02-28",
"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) Price Endpoint
To get OHLC data for a specific time period, use the following endpoint:
GET /open-high-low-close/YYYY-MM-DD
Example response:
{
"success": true,
"timestamp": 1772251753,
"base": "USD",
"date": "2026-02-28",
"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
To get current bid and ask prices for metals, use this endpoint:
GET /bid-ask
Example response:
{
"success": true,
"timestamp": 1772251753,
"base": "USD",
"date": "2026-02-28",
"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
Accessing historical rates for Solana (SOL) and other metals has never been easier, thanks to the comprehensive features offered by the Metals-API. By utilizing various endpoints, developers can retrieve real-time data, historical prices, and perform conversions with ease. The API's capabilities empower developers to create innovative applications that leverage accurate financial data for better decision-making.
For further exploration, consider visiting the Metals-API Documentation for detailed information on each endpoint, or check out the Metals-API Supported Symbols page to familiarize yourself with the available metal symbols. By integrating the Metals-API into your applications, you can stay ahead in the competitive landscape of digital finance.