---
title: "大宗商品 API：金属、能源和实物价格 | Narwhal API"
description: "大宗商品 API，提供现货金属、原油以及棕榈油等实物价格，附原始单位和价格历史。使用免费 API 密钥，通过 REST 或 MCP 调用。"
url: "https://narwhalapi.com/zh/api/commodities"
---

所有 API

# 大宗商品 API

带有原始单位和序列定义的现货金属和实物大宗商品价格。

[获取免费 API 密钥](https://narwhalapi.com/zh/signup)
[阅读文档 →](https://narwhalapi.com/zh/docs/api/commodities.md)

## 首次请求

### 查找印度尼西亚的棕榈油价格

```
curl --request GET \
  --url "https://api.narwhalapi.com/v1/commodities/palmoil/physical?product=ffb&country=IDN" \
  --header "Authorization: Bearer $NARWHAL_API_KEY"
```

响应示例

```
{
  "series": [
    {
      "series_id": "id-ri-oil-palm-ffb-smallholder-purchase-agreement",
      "product": "ffb",
      "observation_type": "age_schedule",
      "period_type": "effective",
      "country": "IDN",
      "area": "ID-RI",
      "producer_arrangement": "purchase_agreement",
      "price_type": "official_purchase_schedule",
      "currency": "IDR",
      "unit": "kilogram",
      "unit_key": "kilogram",
      "coverage_start": "2026-08-19",
      "coverage_end": "2026-09-01",
      "frequency": "weekly"
    }
  ],
  "next_cursor": null
}
```

## 端点

### 现货金属价格 API

GET 获取现货价格`/v1/commodities/spot/{commodity}/{currency}`

获取现货价格或基于期货的参考价格。

#### 参数

- `commodity` 必填 XAU、XAG、XPT、XPD、WTI（WTI 原油）、BRENT（布伦特原油）或 XCU（铜）。
- `currency` 必填 报价货币，用大写字母。黄金支持 31 种货币，其他商品仅以美元报价。

#### 报价

- `symbol` 字符串 商品与报价货币，如 XAU-USD。
- `currency` 字符串 报价货币。
- `unit` 字符串 贵金属用 troy_ounce，WTI 和 BRENT 用 barrel，XCU 用 pound。
- `price` 字符串 一个正数参考价格，以十进制字符串表示。
- `timestamp` 日期时间 报价时间，UTC。
- `stale` 布尔值 报价是否已过时。休市不会使报价过时。

---

[完整参考文档 →](https://narwhalapi.com/zh/docs/api/commodities/spot.md)

GET 获取价格 K 线`/v1/commodities/spot/{commodity}/{currency}/bars`

黄金、白银、铂、钯、铜、WTI 和 BRENT 的开盘、最高、最低、收盘 K 线。

#### 参数

- `commodity` 必填 XAU、XAG、XPT、XPD、WTI（WTI 原油）、BRENT（布伦特原油）或 XCU（铜）。
- `currency` 必填 报价货币，用大写字母。黄金支持 31 种货币，其他商品仅以美元报价。
- `interval` 可选 1m、5m、15m、1h、4h 或 1d。默认为 1d。
- `start` 必填 第一根 K 线，为位于间隔边界上的 UTC 时间。包含在内。
- `end` 必填 最后一根 K 线，为位于间隔边界上的 UTC 时间。不包含在内。
- `limit` 可选 每页的 K 线数量。默认为 100，最大为 500。
- `cursor` 可选 使用相同的查询，复用上一页的 next_cursor。

#### 响应字段

- `bars` 数组 从最早到最新的已收盘 K 线，每根包含时间戳以及十进制字符串形式的开盘价、最高价、最低价和收盘价。非 USD 币种的黄金只有收盘价。
- `next_cursor` 字符串 下一页的游标。没有更多 K 线时为 Null。

---

[完整参考文档 →](https://narwhalapi.com/zh/docs/api/commodities/spot.md)

### 实物大宗商品价格 API

GET 查找 棕榈油 实物数据序列`/v1/commodities/palmoil/physical`

按产品和国家查找已收录的棕榈油现货序列。

#### 参数

- `product` 可选 按实物产品筛选。
- `country` 可选 按国家筛选，例如 IDN。
- `area` 可选 使用发现接口返回的地区标识符：适用时使用 ISO 3166-2，否则使用 Narwhal 定义的 nwl-* 标识符，例如 nwl-mys-north。
- `price_type` 可选 official_purchase_schedule、government_reference 或 market_average。该值必须与产品相容。
- `currency` 可选 按原始币种筛选，例如 IDR、USD 或 MYR。此操作不会换算价格。
- `producer_type` 可选 适用于印度尼西亚 FFB 收购价目表；不能与 product=cpo 一起使用。
- `producer_arrangement` 可选 purchase_agreement 或 supported_scheme。适用于印度尼西亚 FFB 价目表；不能与 product=cpo 一起使用。
- `limit` 可选 每页的最大序列数量。默认为 100。
- `cursor` 可选 使用返回的 next_cursor 继续请求，并保持所有原始筛选条件和 limit 不变。

#### 响应字段

- `series` 数组 按稳定的 series_id 排序的完整已批准数据序列。
- `series[].series_id` 字符串 历史数据操作使用的稳定标识符。
- `series[].product / series[].country` 字符串 产品及地理范围。
- `series[].area` 字符串 全国序列省略 area。地区标识符可能使用 nwl-* 命名空间。
- `series[].observation_type / series[].period_type` 枚举值 scalar 或 age_schedule；effective 或 observation。这些字段定义响应类型及日期含义。
- `series[].price_type / series[].currency / series[].unit` 字符串 来源定义的价格类型、币种和原始单位。
- `series[].unit_key` 字符串 unit_key 是以一种标准写法表示的单位,例如 troy_ounce、barrel 或 tonne;unit 则保留来源的原始写法。当价格以美分报价时,price_scale 为 0.01:将价格乘以该值即可得到以货币计的金额。
- `series[].producer_arrangement` 字符串 仅在来源明确说明安排类型的印度尼西亚 FFB 树龄价目表序列中包含。其他情况省略。
- `series[].frequency / series[].coverage_start / series[].coverage_end` 字符串和日期 发布频率及已接纳的历史日期范围，不保证覆盖期间内没有缺口。
- `next_cursor` 字符串或 null 用于继续分页的令牌；若无更多序列，则为 null。

---

[完整参考文档 →](https://narwhalapi.com/zh/docs/api/commodities/palmoil-physical-series.md)

GET 获取最新 棕榈油 实物价格`/v1/commodities/palmoil/physical/{series_id}`

获取最新一条已收录的棕榈油观测值。

#### 参数

- `series_id` 必填 使用发现接口返回的标识符。
- `price_month` 可选 仅适用于 MPOB CPO。选择一个报价月份；默认使用每份报告自身所属的月份。

#### 响应字段

- `series_id` 字符串 实物数据序列的稳定标识符。
- `currency / unit` 字符串 币种和原始单位：印度尼西亚 FFB 价目表使用 kilogram，CPO 使用 metric_ton，马来西亚 FFB 参考价使用 one_percent_oer。
- `unit_key` 字符串 unit_key 是以一种标准写法表示的单位,例如 troy_ounce、barrel 或 tonne;unit 则保留来源的原始写法。当价格以美分报价时,price_scale 为 0.01:将价格乘以该值即可得到以货币计的金额。
- `period_start / period_end` 日期 按有效期发布的价格包含起止两日。MPOB 的期间从报告日开始，到次日结束，但不包含该结束日。
- `revision` 整数 价格或完整价目表的修订版本。
- `price or prices` 十进制字符串或完整数组 以十进制字符串表示的正数价格，或完整的 prices 数组，其中包含 tree_age_min_years、tree_age_max_years 和 price。树龄上下限均包含在内。马来西亚 FFB 仍使用 one_percent_oer 单位。
- `price_month` YYYY-MM MPOB CPO 报价必需的字段，用于标识报价月份；period_start 和 period_end 标识报告日对应的观测区间。

---

[完整参考文档 →](https://narwhalapi.com/zh/docs/api/commodities/palmoil-physical-price.md)

GET 获取 棕榈油 实物历史数据`/v1/commodities/palmoil/physical/{series_id}/observations`

按从旧到新的顺序获取棕榈油观测值。

#### 参数

- `series_id` 必填 由发现接口返回的序列。
- `start` 可选 查询范围的起始日包含在内，必须同时提供 end。印度尼西亚价格的有效期只要与查询范围重叠就会纳入结果；马来西亚每日价格则按报告日期筛选。
- `end` 可选 不包含的上限，必须晚于 start。
- `limit` 可选 返回的最大观测值数量。默认为 100；树龄价目表始终保持完整。
- `cursor` 可选 继续请求时，保持所有原始参数不变，包括 series_id、日期、limit 和 price_month。已发布数据发生变化可能导致游标过期。
- `price_month` 可选 仅适用于 MPOB CPO。选择一个报价月份；默认使用每份报告自身所属的月份。

#### 响应字段

- `series_id` 字符串 实物数据序列的稳定标识符。
- `currency / unit` 字符串 所有观测值共用的币种和原始单位。
- `unit_key` 字符串 unit_key 是以一种标准写法表示的单位,例如 troy_ounce、barrel 或 tonne;unit 则保留来源的原始写法。当价格以美分报价时,price_scale 为 0.01:将价格乘以该值即可得到以货币计的金额。
- `observations` 数组 期间、修订版本及单一价格或完整价目表，按时间从早到晚排列。MPOB CPO 行保留 price_month；马来西亚 CPO 和 FFB 行保留报告日对应的 period_start/period_end。
- `next_cursor` 字符串或 null 不透明的延续令牌，结束时为 null。

---

[完整参考文档 →](https://narwhalapi.com/zh/docs/api/commodities/palmoil-physical-price-history.md)

## 使用场景

### 每升和每加仑的石油价格

把布伦特或 WTI 从每桶美元换算成每升和每加仑。

[阅读指南 →](https://narwhalapi.com/zh/how-to/convert-the-oil-price-to-litres-and-gallons.md)

### 每公斤和每吨的铜价

把铜价从每磅美元换算成每公斤和每公吨。

[阅读指南 →](https://narwhalapi.com/zh/how-to/convert-the-copper-price-to-kg-and-tonnes.md)

### 金银比

用同一日期或时间的黄金价格除以白银价格。

[阅读指南 →](https://narwhalapi.com/zh/how-to/calculate-the-gold-silver-ratio.md)

### 价格提醒

黄金突破你设定的阈值时发送提醒。

[阅读指南 →](https://narwhalapi.com/zh/how-to/set-up-a-commodity-price-alert.md)

### 价格历史导出为 CSV

把每日黄金价格历史下载为 CSV 文件。

[阅读指南 →](https://narwhalapi.com/zh/how-to/download-commodity-price-history-as-csv.md)

### 以你的货币显示价格

获取以你自己货币计价的商品价格，如每克多少印尼盾。

[阅读指南 →](https://narwhalapi.com/zh/how-to/get-a-commodity-price-in-your-currency.md)

## 覆盖范围

- 黄金[实时现货价格](https://narwhalapi.com/zh/commodities/gold.md)
- 白银[实时现货价格](https://narwhalapi.com/zh/commodities/silver.md)
- 铂金[实时现货价格](https://narwhalapi.com/zh/commodities/platinum.md)
- 钯金[实时现货价格](https://narwhalapi.com/zh/commodities/palladium.md)
- 铜[实时现货价格](https://narwhalapi.com/zh/commodities/copper.md)
- WTI原油[实时现货价格](https://narwhalapi.com/zh/commodities/wti-crude.md)
- 布伦特原油[实时现货价格](https://narwhalapi.com/zh/commodities/brent-crude.md)
- 美国汽油（零售）[周度 · USD/加仑](https://narwhalapi.com/zh/commodities/gasoline.md)
- 美国柴油（零售）[周度 · USD/加仑](https://narwhalapi.com/zh/commodities/diesel.md)
- 商品月度基准[70个序列 · 月度](https://narwhalapi.com/zh/commodities.md#monthly)
- 实物大宗商品价格[实物价格](https://narwhalapi.com/zh/api/commodities/physical.md)
- 天然气[每日观测值](https://narwhalapi.com/zh/commodities/natural-gas.md)

显示全部 54 种大宗商品

- 大豆[月度基准价格](https://narwhalapi.com/zh/commodities/soybeans.md)
- 玉米[月度基准价格](https://narwhalapi.com/zh/commodities/corn.md)
- 牛肉[月度基准价格](https://narwhalapi.com/zh/commodities/beef.md)
- 铝[月度基准价格](https://narwhalapi.com/zh/commodities/aluminium.md)
- 咖啡[月度基准价格](https://narwhalapi.com/zh/commodities/coffee.md)
- 小麦[月度基准价格](https://narwhalapi.com/zh/commodities/wheat.md)
- 食糖[月度基准价格](https://narwhalapi.com/zh/commodities/sugar.md)
- 煤炭[月度基准价格](https://narwhalapi.com/zh/commodities/coal.md)
- 可可[月度基准价格](https://narwhalapi.com/zh/commodities/cocoa.md)
- 镍[月度基准价格](https://narwhalapi.com/zh/commodities/nickel.md)
- 棉花[月度基准价格](https://narwhalapi.com/zh/commodities/cotton.md)
- 大米[月度基准价格](https://narwhalapi.com/zh/commodities/rice.md)
- 尿素[月度基准价格](https://narwhalapi.com/zh/commodities/urea.md)
- 铁矿石[月度基准价格](https://narwhalapi.com/zh/commodities/iron-ore.md)
- 锌[月度基准价格](https://narwhalapi.com/zh/commodities/zinc.md)
- 锡[月度基准价格](https://narwhalapi.com/zh/commodities/tin.md)
- 铅[月度基准价格](https://narwhalapi.com/zh/commodities/lead.md)
- 棕榈油[月度基准价格](https://narwhalapi.com/zh/commodities/palm-oil.md)
- 橡胶[月度基准价格](https://narwhalapi.com/zh/commodities/rubber.md)
- 橙子[月度基准价格](https://narwhalapi.com/zh/commodities/orange.md)
- 茶叶[月度基准价格](https://narwhalapi.com/zh/commodities/tea.md)
- 原油[月度基准价格](https://narwhalapi.com/zh/commodities/crude-oil.md)
- 豆油[月度基准价格](https://narwhalapi.com/zh/commodities/soybean-oil.md)
- 豆粕[月度基准价格](https://narwhalapi.com/zh/commodities/soybean-meal.md)
- 棕榈仁油[月度基准价格](https://narwhalapi.com/zh/commodities/palm-kernel-oil.md)
- 椰子油[月度基准价格](https://narwhalapi.com/zh/commodities/coconut-oil.md)
- 葵花籽油[月度基准价格](https://narwhalapi.com/zh/commodities/sunflower-oil.md)
- 菜籽油[月度基准价格](https://narwhalapi.com/zh/commodities/rapeseed-oil.md)
- 花生油[月度基准价格](https://narwhalapi.com/zh/commodities/groundnut-oil.md)
- 花生[月度基准价格](https://narwhalapi.com/zh/commodities/groundnuts.md)
- 鱼粉[月度基准价格](https://narwhalapi.com/zh/commodities/fish-meal.md)
- 香蕉[月度基准价格](https://narwhalapi.com/zh/commodities/bananas.md)
- 鸡肉[月度基准价格](https://narwhalapi.com/zh/commodities/chicken.md)
- 羔羊肉[月度基准价格](https://narwhalapi.com/zh/commodities/lamb.md)
- 烟草[月度基准价格](https://narwhalapi.com/zh/commodities/tobacco.md)
- 磷酸二铵化肥[月度基准价格](https://narwhalapi.com/zh/commodities/dap.md)
- 重过磷酸钙化肥[月度基准价格](https://narwhalapi.com/zh/commodities/tsp.md)
- 氯化钾[月度基准价格](https://narwhalapi.com/zh/commodities/potash.md)
- 磷矿石[月度基准价格](https://narwhalapi.com/zh/commodities/phosphate-rock.md)
- 原木[月度基准价格](https://narwhalapi.com/zh/commodities/logs.md)
- 锯材[月度基准价格](https://narwhalapi.com/zh/commodities/sawnwood.md)
- 胶合板[月度基准价格](https://narwhalapi.com/zh/commodities/plywood.md)

## 相关 API

### 现货金属价格 API

黄金、白银、铂金和钯金的现货价格，以及 WTI、布伦特和铜的参考价格。

[探索 API →](https://narwhalapi.com/zh/api/commodities/spot.md)

### 实物大宗商品价格 API

涵盖约120种大宗商品的实物价格（金属、电池材料、能源、化肥和化工原料、农产品），另有美国零售燃油（EIA）和World Bank月度基准。包括棕榈油。单位与发布时一致。

[探索 API →](https://narwhalapi.com/zh/api/commodities/physical.md)

### 汇率 API

当前汇率、货币换算和已存储的汇率历史。

[探索 API →](https://narwhalapi.com/zh/api/fx.md)

### 价格

预付额度，每1,000次调用2美元，没有套餐或档位。

[查看价格 →](https://narwhalapi.com/zh/pricing.md)

## 常见问题

哪些大宗商品 API 已上线？

已上线的版本涵盖现货金属和实物大宗商品。期货不对外公开。

我可以获取历史价格吗？

可以。请求已纳入的棕榈油序列的观测值；响应会保留原始单位、生效日期、修订信息和来源数据缺口。

使用数据之前应该检查什么？

单位、价格类型、地域和有效期间都保留在每个已收录的序列上。期货产品目前不公开。

## 从免费密钥开始

每月赠送 10 美元免费额度，无需绑卡。每月 10 美元免费额度，无需绑卡。

[获取免费 API 密钥](https://narwhalapi.com/zh/signup)
