curl --request GET \
--url https://astreus.ai/api/v1/commodities/{symbol}/prices \
--header 'X-API-KEY: <api-key>'import requests
url = "https://astreus.ai/api/v1/commodities/{symbol}/prices"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://astreus.ai/api/v1/commodities/{symbol}/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://astreus.ai/api/v1/commodities/{symbol}/prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://astreus.ai/api/v1/commodities/{symbol}/prices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://astreus.ai/api/v1/commodities/{symbol}/prices")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://astreus.ai/api/v1/commodities/{symbol}/prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"symbol": "GOLD",
"bars": [],
"displayFrom": null,
"window": {
"from": "2026-10-01",
"to": null,
"limit": 2,
"total": 0,
"returned": 0,
"olderTo": "2026-09-01"
},
"instrument": {
"symbol": "GOLD",
"name": "Gold",
"unit": "USD per troy ounce",
"asset_class": "metals",
"provider": "WORLDBANK",
"frequency": "M",
"series_title": "Gold (Pink Sheet)",
"external_series_id": "CMO_GOLD"
},
"attribution": "Source: World Bank Commodity Price Data (The Pink Sheet), CC BY 4.0"
}{
"error": "<string>",
"code": "unknown_parameter",
"param": "<string>",
"allowed": [
"<string>"
]
}{
"error": "<string>",
"code": "unknown_parameter",
"param": "<string>",
"allowed": [
"<string>"
]
}{
"error": "<string>",
"code": "unknown_parameter",
"param": "<string>",
"allowed": [
"<string>"
]
}{
"error": "<string>",
"code": "unknown_parameter",
"param": "<string>",
"allowed": [
"<string>"
]
}Instrument prices
Daily bars for an instrument (close-only: open, high and low repeat the close; volume is 0). Bars run from the first trading day of range to the latest; lookback adds earlier bars for moving averages. coverageFrom is the first day held; note says when the history starts after the range’s first day or no bar falls inside it. Bar times t are epoch ms at UTC midnight. An unknown symbol is a 404.
curl --request GET \
--url https://astreus.ai/api/v1/commodities/{symbol}/prices \
--header 'X-API-KEY: <api-key>'import requests
url = "https://astreus.ai/api/v1/commodities/{symbol}/prices"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://astreus.ai/api/v1/commodities/{symbol}/prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://astreus.ai/api/v1/commodities/{symbol}/prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://astreus.ai/api/v1/commodities/{symbol}/prices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://astreus.ai/api/v1/commodities/{symbol}/prices")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://astreus.ai/api/v1/commodities/{symbol}/prices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"symbol": "GOLD",
"bars": [],
"displayFrom": null,
"window": {
"from": "2026-10-01",
"to": null,
"limit": 2,
"total": 0,
"returned": 0,
"olderTo": "2026-09-01"
},
"instrument": {
"symbol": "GOLD",
"name": "Gold",
"unit": "USD per troy ounce",
"asset_class": "metals",
"provider": "WORLDBANK",
"frequency": "M",
"series_title": "Gold (Pink Sheet)",
"external_series_id": "CMO_GOLD"
},
"attribution": "Source: World Bank Commodity Price Data (The Pink Sheet), CC BY 4.0"
}{
"error": "<string>",
"code": "unknown_parameter",
"param": "<string>",
"allowed": [
"<string>"
]
}{
"error": "<string>",
"code": "unknown_parameter",
"param": "<string>",
"allowed": [
"<string>"
]
}{
"error": "<string>",
"code": "unknown_parameter",
"param": "<string>",
"allowed": [
"<string>"
]
}{
"error": "<string>",
"code": "unknown_parameter",
"param": "<string>",
"allowed": [
"<string>"
]
}Authorizations
Astreus API key (pk_live_...), created on the Developers page in the terminal. Also accepted as Authorization: Bearer pk_live_....
Path Parameters
Instrument symbol.
Query Parameters
Window of bars served: from the range's first day (1M = 31 days back, YTD = 1 January) to the latest bar; ALL is the whole history. rangeFrom echoes the first day; displayFrom is the epoch ms of the first bar inside the range.
1M, 3M, 6M, YTD, 1Y, 2Y, 5Y, ALL Bars to add before the range's first day, e.g. 200 to draw a 200-day moving average from the first bar. Default 0: only bars inside the range. lookbackBars says how many were added.
0 <= x <= 1000First day (default the range's first day), YYYY-MM-DD.
Last day, YYYY-MM-DD.
Latest N bars in the window, 1–100000. With from, to, limit or frequency only the window's bars are served, plus window and instrument blocks; lookback does not apply.
1 <= x <= 100000Bar frequency: daily (the default), weekly or monthly (the last close of each week or month).
daily, weekly, monthly