← 金融与货币

商品价格

GET /commodities/:commodity

获取特定商品(黄金、白银、铂金、钯金、石油、天然气或铜)以 30 种支持货币中任意一种计价的当前价格。返回美元基础价格和转换后的价格。当你只需要一种商品的价格而非完整列表时非常有用,例如在北欧投资页面上以 NOK 显示金价。

参数

commodity 必填

Commodity name in URL

currency 可选 默认: USD

Price currency

请求示例

基本用法
curl "https://nordapi.ee/api/v1/commodities/gold?currency=NOK"
Gold price in NOK
curl "https://nordapi.ee/api/v1/commodities/gold?currency=NOK"
Crude oil price in USD
curl "https://nordapi.ee/api/v1/commodities/oil"
Silver price in EUR
curl "https://nordapi.ee/api/v1/commodities/silver?currency=EUR"

实时响应

HTTP 404: {
  "error": "Currency not found",
  "message": "One or more of the specified currencies could not be found.",
  "success": false
}

响应示例

{"success":true,"commodity":"gold","price":29063.87,"currency":"NOK","price_usd":3045.0}