Skip to main content
GET
/
api
/
v1
/
instruments
/
{instrument}
/
candles
Get aggregated candles data per instrument
curl --request GET \
  --url https://api.international.coinbase.com/api/v1/instruments/{instrument}/candles
import requests

url = "https://api.international.coinbase.com/api/v1/instruments/{instrument}/candles"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.international.coinbase.com/api/v1/instruments/{instrument}/candles', 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://api.international.coinbase.com/api/v1/instruments/{instrument}/candles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$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://api.international.coinbase.com/api/v1/instruments/{instrument}/candles"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.international.coinbase.com/api/v1/instruments/{instrument}/candles")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.international.coinbase.com/api/v1/instruments/{instrument}/candles")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "aggregations": [
    {
      "start": "2024-04-23T00:00:00Z",
      "open": "62884.4",
      "high": "64710.6",
      "low": "62884.4",
      "close": "63508.4",
      "volume": "3253.9983"
    }
  ]
}
InstrumentsService instrumentsService = IntxServiceFactory.createInstrumentsService(client);
GetAggregatedCandlesRequest request = new GetAggregatedCandlesRequest.Builder()
    .instrumentId("BTC-PERP")
    .granularity("ONE_DAY")
    .start("2024-01-01T00:00:00Z")
    .build();
GetAggregatedCandlesResponse response = instrumentsService.getAggregatedCandles(request);
For more information, please visit the INTX Java SDK.

Path Parameters

instrument
string
required

Identifies the instrument by name (e.g., BTC-PERP)

Query Parameters

granularity
enum<string>
required

The aggregation period of the candles data. End timestamp in ISO 8601 timestamp format (e.g. 2024-03-01T00:00:00Z).

Available options:
ONE_DAY,
SIX_HOUR,
TWO_HOUR,
ONE_HOUR,
THIRTY_MINUTE,
FIFTEEN_MINUTE,
FIVE_MINUTE,
ONE_MINUTE
start
string
required

Start timestamp in ISO 8601 timestamp format (e.g. 2024-03-01T00:00:00Z)

end
string

End timestamp in ISO 8601 timestamp format (e.g. 2024-03-01T00:00:00Z)

Response

Instrument list

aggregations
object[]