GET /commodities/:commodity
Hämta det aktuella priset för en specifik råvara (guld, silver, platina, palladium, olja, natural_gas eller koppar) i valfri av de 30 stödda valutorna. Returnerar både USD-baspriset och det konverterade priset. Användbart när du bara behöver en råvaras pris i stället för hela listan, som att visa guldpriset i NOK på en nordisk investeringssida.
commodity
obligatorisk
Commodity name in URL
currency
valfri
standard: USD
Price currency
| Namn | Obligatorisk | Standard | Beskrivning |
|---|---|---|---|
commodity |
Ja | - | Commodity name in URL |
currency |
Nej | USD | Price currency |
curl "https://nordapi.ee/api/v1/commodities/gold?currency=NOK"
curl "https://nordapi.ee/api/v1/commodities/gold?currency=NOK"
curl "https://nordapi.ee/api/v1/commodities/oil"
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}