← Back to API Ninjas
GET/v1/commodityprice

Get current commodity price (single or batch)

Returns the current price for a single commodity (`name`). Optional `currency` and `unit` parameters convert the response from the native USD/USX quote into any supported currency and unit.

API Ninjas·$0.001 per call

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "api-ninjas", path: "/v1/commodityprice" }); console.log(output);

Query parameters

name
string

Name of a single commodity. (Allowed: gold, soybean_oil, wheat, platinum, micro_silver, lean_hogs, corn, oat, aluminum, soybean_meal, silver, soybean, lumber, live_cattle, sugar, natural_gas, crude_oil, orange_juice, coffee, cotton, copper, micro_gold, feeder_cattle, rough_rice, palladium, cocoa, brent_crude_oil, gasoline_rbob, heating_oil, class_3_milk)

currency
string

ISO 4217 currency code to convert the price into (e.g., EUR, GBP, INR). When provided, USX prices are first normalized to USD before conversion. Defaults to the native USD/USX quote.

unit
string

Target mass/volume/energy unit to convert the price into (e.g., kg, g, lb, metric_ton, liter). Bushel and board_feet are commodity-specific and cannot be cross-converted.

    Orthogonal - Giving AI agents the tools they need.