Prices

Get latest price for a commodity

Changed on

Retrieve the most recent price for a specific commodity or a comma-separated basket. The container-freight composite, Shanghai–Genoa and Shanghai–Los Angeles codes and their legacy DREWRY_WCI_* names resolve to the same stored series in a basket. Each group returns one quote, even when both names are requested. The returned code remains the actual stored code; requested_code and alias_of disclose a different requested name when the basket did not also request the served code. Missing groups are accounted for under the names requested, and stale data is not made fresh.

get/v1/prices/latest

Request

  • Base URL
    https://api.oilpriceapi.com
  • Auth
    API key in header Authorization

Query parameters

partialboolean
Example:true

Opt in to partial JSON results for multiple codes. Valid codes are returned in data.prices and rejected codes in data.missing with a reason. Requires an API key. All-invalid input remains 400; no available prices returns 404. The default and single-code responses are unchanged. Authentication, entitlements, quota and the 20-code cap still apply.

by_code'ALUMINUM_USD' | 'AMMONIA_USD' | 'ASPHALT_USD' | 'AZERI_LIGHT_USD' | 'BAKKEN_DUC_WELLS' | 'BAKKEN_FRAC_SPREADS' | 'BIODIESEL_USD' | 'BONNY_LIGHT_USD' | 'BRENT_CRUDE_USD' | 'CANADA_RIG_COUNT' | 'CAPP_COAL_USD' | 'CME_COAL_USD' | 'COAL_USD' | 'COKING_COAL_USD' | 'COPPER_USD' | 'CUSHING_STORAGE' | 'DIESEL_USD' | 'DUBAI_CRUDE_USD' | 'DUTCH_TTF_EUR' | 'DUTCH_TTF_NATURAL_GAS_USD' | 'EAGLEFORD_DUC_WELLS' | 'EAGLEFORD_FRAC_SPREADS' | 'ESPO_CRUDE_USD' | 'ETHANOL_USD' | 'ETHYLENE_USD' | 'EUR_USD' | 'USD_NOK' | 'EUR_NOK' | 'EU_CARBON_EUR' | 'UK_CARBON_GBP' | 'GASOLINE_RBOB_USD' | 'GASOLINE_USD' | 'GBP_USD' | 'GOLD_USD' | 'SILVER_USD' | 'GOLD_AM_USD' | 'GOLD_AM_GBP' | 'GOLD_AM_EUR' | 'GOLD_PM_USD' | 'GOLD_PM_GBP' | 'GOLD_PM_EUR' | 'SILVER_FIX_USD' | 'SILVER_FIX_GBP' | 'SILVER_FIX_EUR' | 'HEATING_OIL_USD' | 'HFO_380_USD' | 'ILLINOIS_COAL_USD' | 'INTERNATIONAL_RIG_COUNT' | 'IRON_ORE_USD' | 'JET_A1_NWE_USD' | 'JET_FUEL_USD' | 'JKM_LNG_USD' | 'JOHAN_SVERDRUP_USD' | 'LEAD_USD' | 'LOUISIANA_LIGHT_USD' | 'MARS_USD' | 'MGO_05S_USD' | 'METHANOL_USD' | 'MURBAN_CRUDE_USD' | 'NAPHTHA_USD' | 'NICKEL_USD' | 'NATURAL_GAS_GBP' | 'NATURAL_GAS_STORAGE' | 'NATURAL_GAS_USD' | 'NEWCASTLE_COAL_USD' | 'NORTH_DAKOTA_WELL_PERMITS' | 'NYMEX_APPALACHIAN_USD' | 'NYMEX_WESTERN_RAIL_USD' | 'OKLAHOMA_WELL_PERMITS' | 'PALLADIUM_USD' | 'PERMIAN_DUC_WELLS' | 'PERMIAN_FRAC_SPREADS' | 'POLYETHYLENE_USD' | 'POLYPROPYLENE_USD' | 'PLATINUM_USD' | 'PRB_COAL_USD' | 'TAPIS_CRUDE_USD' | 'TIN_USD' | 'TEXAS_WELL_PERMITS' | 'ULSD_DIESEL_USD' | 'URALS_CRUDE_USD' | 'URANIUM_USD' | 'UREA_USD' | 'US_RIG_COUNT' | 'VLSFO_USD' | 'WCS_CRUDE_USD' | 'WTI_USD' | 'ZINC_USD'
Example:MURBAN_CRUDE_USD

Commodity code or comma-separated commodity codes (defaults to BRENT_CRUDE_USD). Physical crude coverage includes MURBAN_CRUDE_USD, BONNY_LIGHT_USD, MARS_USD, LOUISIANA_LIGHT_USD, ESPO_CRUDE_USD, and JOHAN_SVERDRUP_USD.

These series have different publication cadences. Use as_of, data_status, stale, and freshness in the response rather than assuming the API collection time is the market date. Mars and LLS are monthly EIA first-purchase statistics and not live traded assessments; Johan Sverdrup is a quarterly-finalized tax-reference norm price; ESPO is an intermittent public snapshot.

Strict one-way aliases such as ASPHALT_USD to BITUMEN_USD resolve to their canonical series in single and multi-code requests. The returned code identifies the actual series. When a legacy alias is served by a different code, requested_code and alias_of disclose the mapping. A batch requesting both names returns one row for that canonical quote and does not list either as missing. BRENT_SPOT_EUROPE_USD is a dual-writer exception: it can serve its own newer observation of the same series instead of BRENT_SPOT_USD.

by_type'spot_price' | 'daily_average_price'
Example:spot_price

Price type

Response

Latest price data. A single by_code returns a flat data object (LatestPriceResponse); multiple comma-separated codes return data.prices[] (LatestPricesResponse).

OR

Example response

{
  "status": "success",
  "data": {
    "benchmark": {
      "id": "nymex_wti_front_month",
      "instrument_type": "front_month_futures",
      "quote_type": "indicative_last_price",
      "unit": "barrel",
      "contract_month": "2026-12",
      "roll_method": "explicit_contract_curve",
      "roll_signal": "volume"
    },
    "price": 68.58,
    "formatted": "$68.58",
    "currency": "USD",
    "code": "WTI_USD",
    "requested_code": "ASPHALT_USD",
    "alias_of": "BITUMEN_USD",
    "contract_month": "2026-12",
    "created_at": "2026-07-03T13:43:01.099Z",
    "updated_at": "2026-07-03T13:43:01.099Z",
    "type": "spot_price",
    "unit": "barrel",
    "source": "market_reporting",
    "observed_at": "2026-07-13T12:00:00.000Z",
    "source_date": "2026-07-13",
    "as_of": "2026-07-13T12:00:00.000Z",
    "collected_at": "2026-07-15T21:00:00.000Z",
    "ingested_at": "2026-07-15T21:00:00.000Z",
    "age_days": 2,
    "price_type": "spot_price",
    "data_status": "current",
    "freshness": {
      "status": "current",
      "age_seconds": 275,
      "expected_max_age_seconds": 1800
    },
    "changes": {
      "24h": {
        "amount": 0.72,
        "percent": 1.06,
        "previous_price": 67.86
      },
      "7d": {
        "amount": 0.72,
        "percent": 1.06,
        "previous_price": 67.86
      },
      "30d": {
        "amount": 0.72,
        "percent": 1.06,
        "previous_price": 67.86
      },
      "90d": {
        "amount": 0.72,
        "percent": 1.06,
        "previous_price": 67.86
      }
    },
    "metadata": {
      "source": "market_reporting",
      "source_description": "Aggregated from published market sources"
    }
  }
}

Changes

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property /////// to the response with the status

    • info

      added the optional property /////// to the response with the status

    • breaking

      the response property ///////// became nullable for the status

    • breaking

      the response property /////// became nullable for the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property ///////// to the response with the status

    • info

      added the optional property /////// to the response with the status

    • info

      added the optional property /////// to the response with the status

    • info

      added the optional property /////// to the response with the status