Announcing the new /ohlc API Endpoint

Last updated on January 31, 2025

< Back to Blogs

New API Endpoint: ohlc

We are thrilled to announce a powerful new feature for MetalPriceAPI: the /ohlc endpoint. This addition is designed to provide you with comprehensive open, high, low, and close price data for a given symbol and date, essential for making informed business decisions.

Why OHLC Data Matters

OHLC data is a cornerstone for professionals in various business functions. These four data points offer crucial insights into market trends and price movements:

  • Open and Close Prices: Indicate the market's direction over a specific period.
  • High and Low Prices: Reveal the full trading range and volatility.
  • Comprehensive Analysis: Together, they help identify patterns and inform strategic business decisions.

What is the /ohlc Endpoint?

The /ohlc endpoint provides a simple and efficient way to access this valuable data, helping you stay ahead in dynamic markets.

How to Use the /ohlc Endpoint

To access your usage data, make a GET request to the following URL:

https://api.metalpriceapi.com/v1/ohlc?api_key=[API_KEY]&base=[BASE]&currency=[CURRENCY]&date=[DATE]

Request Parameters

  • api_key: [Required] Your unique API key. Ensure you replace [API_KEY] with your actual key to authenticate your request.
  • base: [Required] The base currency symbol.
  • currency: [Required] The quote currency symbol.
  • date: [Required] The date for which you want the OHLC data.

Example API Response

Upon a successful request, you will receive a response in JSON format:

{
    "success": true,
    "base": "XAU",
    "quote": "USD",
    "timestamp": 1738108799,
    "rate": {
        "close": 2742.2233288617,
        "high": 2764.9591200794,
        "low": 2735.1078165826,
        "open": 2741.9706872366
    }
}

Response Attributes

  • success: Indicates whether the API request was successful.
  • base: The base currency.
  • quote: The quote currency.
  • timestamp: The timestamp of the data.
  • rate: The open, high, low, and close prices for the given symbol and date.

Get Started Today

To start using the /ohlc endpoint, simply include your API key in the request URL and retrieve your OHLC data instantly. For more details on managing your API key and understanding your plan, visit our API documentation.

We hope this new feature enhances your experience with MetalPriceAPI. As always, we are here to support you. If you have any questions or need assistance, please contact our support team.