curl -X GET "https://api.massive.com/v2/aggs/ticker/X:BTCUSD/range/1/day/2026-07-18/2026-08-17?adjusted=true&sort=asc&limit=120&apiKey=YOUR_API_KEY"
from massive import RESTClient
client = RESTClient("YOUR_API_KEY")
aggs = []
for a in client.list_aggs(
"X:BTCUSD",
1,
"day",
"2026-07-18",
"2026-08-17",
adjusted="true",
sort="asc",
limit=120,
):
aggs.append(a)
print(aggs)
package main
import (
"context"
"fmt"
"log"
"github.com/massive-com/client-go/v3/rest"
"github.com/massive-com/client-go/v3/rest/gen"
)
func main() {
c := rest.NewWithOptions("YOUR_API_KEY",
rest.WithTrace(false),
rest.WithPagination(true),
)
ctx := context.Background()
params := &gen.GetCryptoAggregatesParams{
Adjusted: rest.Ptr(true),
Sort: "asc",
Limit: rest.Ptr(120),
}
resp, err := c.GetCryptoAggregatesWithResponse(
ctx,
"X:BTCUSD",
1,
"day",
"2026-07-18",
"2026-08-17",
params,
)
if err != nil {
log.Fatal(err)
}
if err := rest.CheckResponse(resp); err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", resp.JSON200)
}
import { restClient } from '@massive.com/client-js';
const apiKey = "YOUR_API_KEY";
const rest = restClient(apiKey, 'https://api.massive.com');
async function example_getCryptoAggregates() {
try {
const response = await rest.getCryptoAggregates(
{
cryptoTicker: "X:BTCUSD",
multiplier: "1",
timespan: "day",
from: "2026-07-18",
to: "2026-08-17",
adjusted: "true",
sort: "asc",
limit: "120"
}
);
console.log('Response:', response);
} catch (e) {
console.error('An error happened:', e);
}
}
example_getCryptoAggregates();
package com.massive.client
import com.massive.client.apis.DefaultApi
import com.massive.client.infrastructure.*
import com.massive.client.models.*
fun main() {
ApiClient.apiKey["apiKey"] = "YOUR_API_KEY"
val api = DefaultApi()
try {
val result = api.getCryptoAggregates(
cryptoTicker = "X:BTCUSD",
multiplier = "1",
timespan = "day",
from = "2026-07-18",
to = "2026-08-17",
adjusted = "true",
sort = "asc",
limit = "120"
)
println(result)
} catch (e: Exception) {
println("Error calling getCryptoAggregates: ${e.message}")
e.printStackTrace()
}
}