---
title: "Get price context for a code"
method: GET
path: "/v1/indicators/price-context"
tags: ["Indicators"]
---

# Get price context for a code

`GET /v1/indicators/price-context`

## Request

- Base URL: `https://api.oilpriceapi.com`
- URL: `https://api.oilpriceapi.com/v1/indicators/price-context`
- Auth: API key in header `Authorization`

Statistical context for a commodity's current price.

## Query parameters

- `code` string, required

## Response `200`

Get price context for a code

- object
  - `status` string, required
  - `data` object, required
    - `code` string
    - `price` number
    - `context_as_of` string, date-time: Historical inputs are cached for up to 15 minutes. Changes, ranks and anomaly calculations use the current response price.
    - `context` object
    - `timestamp` string, date-time

## Other responses

- `400`: A required parameter is missing or invalid. The message enumerates valid values.
- `401`: Missing or invalid API key.
- `500`: Unexpected server error. Retry transient failures with bounded backoff and retain the request ID when contacting support.

## Changes

- **2026-09-26** `ee078187e2f6`: 1 info
  - added the optional property `data/context_as_of` to the response with the `200` status
- **2026-08-25** `0e79e21dee2e`: 1 breaking, 4 info
  - added the new required `query` request parameter `code`
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `401`
  - added the non-success response with the status `400`
  - …1 more

[Operation history](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/changes/v1/indicators/price-context/get.md)

---

[API](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1.md) - [All operations](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/revisions/7f8b4d763210?raw)
