Skip to main content
GET
/
openapi
/
v1
/
commodities
List commodity prices
curl --request GET \
  --url https://api.hayinsights.com/openapi/v1/commodities \
  --header 'X-API-Key: <api-key>'
{
  "success": true,
  "statusCode": 200,
  "data": [
    {
      "id": "zinc-lme",
      "name": "Zinc (LME)",
      "category": "metals",
      "unit": "USD/ton",
      "lastClose": 3588,
      "currency": "USD",
      "change1dPct": 0.53,
      "changeMtdPct": 0.28,
      "changeYtdPct": 14.63,
      "ma50": 3475.3036,
      "trend": "bullish",
      "trendline": [
        3530,
        3537,
        3555.5,
        3491,
        3588
      ],
      "updatedAt": "2026-06-17T00:00:00.000Z"
    },
    {
      "id": "wti-crude",
      "name": "WTI Crude Oil",
      "category": "energy",
      "unit": "USD/bbl",
      "lastClose": 76.55,
      "currency": "USD",
      "change1dPct": -0.33,
      "changeMtdPct": -18.93,
      "changeYtdPct": 33.41,
      "ma50": 95.1804,
      "trend": "bearish",
      "trendline": [
        84.29,
        81.85,
        82.27,
        76.8,
        76.55
      ],
      "updatedAt": "2026-06-19T00:00:00.000Z"
    }
  ],
  "meta": {
    "timestamp": "2026-06-19T08:50:00.811Z"
  }
}

Authorizations

X-API-Key
string
header
required

Your HayInsights API key (prefixed apk_). Create and manage keys in the HayInsights dashboard (Account → API keys).

Send it in the X-API-Key header on every request to /openapi/v1/*. Which data domains you may access and your request quota are both governed by the subscription plan attached to the key — see the Plans & features and Rate limits guides.

Query Parameters

category
enum<string>

Filter by commodity category.

ValueDescription
energyEnergy (crude oil, natural gas, …)
metalsMetals (gold, silver, copper, …)
agricultureAgricultural commodities (grains, softs, …)
macroMacro indices (US Dollar Index, …)

Commodity category.

Available options:
energy,
metals,
agriculture,
macro
Example:

"metals"

Free-text search on the commodity name.

Example:

"gold"

sort
enum<string>
default:name

Field to sort by.

ValueDescription
nameCommodity name
priceLatest price
change_1d1-day price change
mtdMonth-to-date change
ytdYear-to-date change
Available options:
name,
price,
change_1d,
mtd,
ytd
order
enum<string>
default:desc

Sort direction.

Available options:
asc,
desc
Example:

"desc"

Response

List of commodity price snapshots.

Standard success envelope shared by every endpoint. Each operation's response wrapper extends this (via allOf) and adds a typed data property.

success
boolean
required

Always true for a successful response.

Example:

true

statusCode
integer
required

Mirrors the HTTP status code.

Example:

200

data
object[]
required
meta
object

Response metadata. Always present; timestamp is the server time the response was generated.