Get historical prices for assets
Get historical prices for assets
Parameters
End timestamp for interval range (inclusive)
Must be provided as unix timestamp (in seconds)
Start timestamp for interval range (inclusive)
Must be provided as unix timestamp (in seconds)
Optional comma-separated list of asset IDs to filter for. If excluded, values will be returned for all assets.
Interval value
E.g. for interval buckets of 2h: interval=2&period=h
Maximum number of time buckets/intervals to return.
For responses with multiple series, this limit is applied to each series individually rather than accumulating across series. This is a limit of returned interval sections, it is not a limit of returned points.
In other words, limit=200 will provide 200 time points for a single series. For multi-series responses, each series will also see the exact same set of 200 time points.
Get historical prices for assets
from neptune_api_v2 import NeptuneAPIV2
client = NeptuneAPIV2()
response = client.assets.get_price_history(
end=0,
period="h",
start=0,
)
print(response.data){
"data": {
"range": {
"start": 1775173209,
"end": 1775778009,
"interval": {
"value": 1,
"unit": "d"
}
},
"series": [
{
"asset": {
"id": "native;inj",
"group": "native",
"group_key": "inj"
},
"points": [
{
"t": 1775173209,
"v": "0.1"
},
{
"t": 1775259609,
"v": "0.1"
},
{
"t": 1775346009,
"v": "0.1"
},
{
"t": 1775432409,
"v": "0.1"
},
{
"t": 1775518809,
"v": "0.1"
},
{
"t": 1775605209,
"v": "0.1"
},
{
"t": 1775691609,
"v": "0.1"
},
{
"t": 1775778009,
"v": "0.1"
}
]
}
],
"pagination": {
"next_offset": 200,
"interval_count": 221
}
},
"error": null,
"status": 200,
"status_text": "200 OK"
}{
"data": null,
"error": {
"kind": "internal",
"scope": "server",
"message": "An unexpected error occurred"
},
"status": 500,
"status_text": "500 Internal Server Error"
}Returns Examples
{
"data": {
"range": {
"start": 1775173209,
"end": 1775778009,
"interval": {
"value": 1,
"unit": "d"
}
},
"series": [
{
"asset": {
"id": "native;inj",
"group": "native",
"group_key": "inj"
},
"points": [
{
"t": 1775173209,
"v": "0.1"
},
{
"t": 1775259609,
"v": "0.1"
},
{
"t": 1775346009,
"v": "0.1"
},
{
"t": 1775432409,
"v": "0.1"
},
{
"t": 1775518809,
"v": "0.1"
},
{
"t": 1775605209,
"v": "0.1"
},
{
"t": 1775691609,
"v": "0.1"
},
{
"t": 1775778009,
"v": "0.1"
}
]
}
],
"pagination": {
"next_offset": 200,
"interval_count": 221
}
},
"error": null,
"status": 200,
"status_text": "200 OK"
}{
"data": null,
"error": {
"kind": "internal",
"scope": "server",
"message": "An unexpected error occurred"
},
"status": 500,
"status_text": "500 Internal Server Error"
}