Simplify Your Analysis with User-Friendly API Integration. OilpriceAPI is a JSON REST API that provides live and historical price data for Brent Crude, WTI, Natural Gas, Gold in a clean and simple way.
Navigate the complexities of the market with confidence. Our extensive range of real-time metrics, including Brent Crude, WTI, Natural Gas, and Gold, provides you with the insights needed to make informed decisions.
We understand the value of accurate and timely data. That's why we continuously expand our offerings to include the latest measures, keeping you ahead in a dynamic environment.
Join users from over 20 countries who depend upon OILpriceAPI for Real-Time Data. Subscribe below for updates
OilpriceAPI is a modern JSON API that returns well formatted, live and historical oil price data. Each API endpoint is simple and self-explanatory. For a list of all available endpoints please see our documentation.
Returns the latest oil price (default: brent crude). The price provided can have a 1-5 minute delay from true live prices.
Returns all oil price data available within the last 24 hours.
Returns all oil price data available within the last 7 days.
Returns all oil price data available within the last 30 days.
Returns all oil price data available within the last 365 days.
Fetch the oil price in your app in just a few minutes.
OilpriceAPI should be used for display, analysis & educational purposes. The data should not be relied upon to make financial decisions.
OilpriceAPI provides a manufactured price that is calculated by averaging many publicly available live price sources on a minute by minute basis. It should therefore be considered an approximated live price.
OilpriceAPI has over 5 million oil price data points and daily average prices that go back as far as May 1987.
OilpriceAPI is a RESTful API designed to provide historical or live oil prices through various endpoints and parameters.
The latest price data provided by OilpriceAPI is a manufactured price, calculated by averaging many publicly available live price sources on a minute-by-minute basis. This makes it an approximated live price.
To authenticate requests, use an API token obtained from the OilpriceAPI Dashboard. The token should be included in the request's Authorization header.
OilpriceAPI uses standard HTTP response codes: 2xx for success, 4xx for client errors (e.g., missing parameters or expired API token), and 5xx for server errors.
Yes, all endpoints except for "latest" return paginated results, limited to 100 results per page. Pagination information is available in the response headers.
You can refine your data request using parameters such as by_type (spot_price or daily_average_price), by_code (e.g., BRENT_CRUDE_USD, WTI_USD, NATURAL_GAS_USD, NATURAL_GAS_GBP, GOLD_USD), and by_period for specific time frames.
Endpoints include prices/latest for the latest oil price, prices/past_day, prices/past_week, prices/past_month, and prices/past_year for historical data.