Price Utility Endpoints
These endpoints support specific product workflows around the core price API. Prefer /v1/prices/latest and /v1/prices/historical for new general-purpose integrations unless a workflow below matches your use case.
Endpoints
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /v1/prices/crude-oil | Crude-oil focused latest-price helper |
| GET | /v1/prices/data-connector | Connector payload used by data-connector integrations |
| GET | /v1/prices/history | Alias — serves /v1/prices/historical directly (no redirect) |
| GET | /v1/prices/metrics | Price API metrics payload |
/v1/prices/crude-oil
curl "https://api.oilpriceapi.com/v1/prices/crude-oil" \
-H "Authorization: Token YOUR_API_KEY"
Returns a crude-focused price payload for WTI, Brent, and related crude benchmarks. Benchmarks resolve independently, so the payload can carry a per-benchmark error alongside successful ones (e.g. "brent": {"error": "No price data found"} while WTI resolves) — check each benchmark's entry before reading its price.
/v1/prices/data-connector
curl "https://api.oilpriceapi.com/v1/prices/data-connector" \
-H "Authorization: Token YOUR_API_KEY"
Used by connector workflows such as the Ship & Bunker connector. Treat the shape as integration-specific and pin your downstream parser to the fields you actually use.
Requires organization membership: an API key that does not belong to an organization receives 403 Forbidden with error code ORG_REQUIRED, regardless of plan. Contact support to have your account attached to an organization if your integration needs this endpoint.
/v1/prices/history
curl "https://api.oilpriceapi.com/v1/prices/history?by_code=WTI_USD&start_date=2026-01-01&end_date=2026-01-31" \
-H "Authorization: Token YOUR_API_KEY"
/v1/prices/history is a direct-serve alias for the canonical Historical Prices endpoint: it runs the same action and returns the same 200 response — verified live, the two bodies are byte-identical for identical parameters. It exists so clients that guessed the singular path still work.
It used to answer with a 301 redirect; the near-miss aliases were changed to serve their canonical actions directly (api#7098) because the redirect rebuilt the caller's query string — including ?api_key= credentials — into the Location response header. There is no redirect to follow anymore, so -L is unnecessary (though harmless). Use /v1/prices/historical in new integrations.
/v1/prices/metrics
curl "https://api.oilpriceapi.com/v1/prices/metrics" \
-H "Authorization: Token YOUR_API_KEY"
Returns price API metrics for monitoring and internal operational dashboards.
Do Not Use Yet
GET /v1/prices/export is intentionally not documented as a working endpoint here because the current backend issue list records a hard 500. Wait for the backend fix before building exports.
Error Cases
| Status | When |
|---|---|
400 | Missing required query parameter or invalid code |
401 | Missing or invalid API key |
402 | Quota exhausted |
403 | ORG_REQUIRED — /v1/prices/data-connector called with a key that has no organization membership |
429 | Rate limit exceeded |