Skip to main content
GET
/
api
/
v1
/
market-data
Retrieve market data for a given list of markets
curl --request GET \
  --url https://market-data.sandbox.rails.xyz/api/v1/market-data
import requests

url = "https://market-data.sandbox.rails.xyz/api/v1/market-data"

response = requests.get(url)

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

fetch('https://market-data.sandbox.rails.xyz/api/v1/market-data', 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://market-data.sandbox.rails.xyz/api/v1/market-data",
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://market-data.sandbox.rails.xyz/api/v1/market-data"

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://market-data.sandbox.rails.xyz/api/v1/market-data")
.asString();
require 'uri'
require 'net/http'

url = URI("https://market-data.sandbox.rails.xyz/api/v1/market-data")

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
[
  {
    "market": "BTC-USDT",
    "type": "INDEX",
    "index": "CCIX",
    "value": "58400.1937255873",
    "updatedAt": 1726171141994
  },
  {
    "market": "BTC-USDT",
    "type": "24H_COUNT",
    "index": "RAILS",
    "value": "46730",
    "updatedAt": 1726171109083
  },
  {
    "market": "BTC-USDT",
    "type": "24H_VOLUME",
    "index": "RAILS",
    "value": "28313423.250000027202",
    "updatedAt": 1726171109083
  },
  {
    "market": "BTC-USDT",
    "type": "ASK",
    "index": "RAILS",
    "value": "58191.7113328",
    "updatedAt": 1726174865550
  },
  {
    "market": "BTC-USDT",
    "type": "BID",
    "index": "RAILS",
    "value": "58180.07415425",
    "updatedAt": 1726174865550
  },
  {
    "market": "BTC-USDT",
    "type": "FUNDING",
    "index": "RAILS",
    "value": "0.0000666285937435",
    "updatedAt": 1726167616514
  },
  {
    "market": "BTC-USDT",
    "type": "NEXT_FUNDING",
    "index": "RAILS",
    "value": "0.0000666285937435",
    "updatedAt": 1726167616514
  },
  {
    "market": "BTC-USDT",
    "type": "OPEN_INTEREST",
    "index": "RAILS",
    "value": "53.28177507",
    "updatedAt": 1726170313764
  },
  {
    "market": "ETH-USDT",
    "type": "INDEX",
    "index": "CCIX",
    "value": "2360.74497472941",
    "updatedAt": 1726171140745
  },
  {
    "market": "ETH-USDT",
    "type": "24H_COUNT",
    "index": "RAILS",
    "value": "46948",
    "updatedAt": 1726171109083
  },
  {
    "market": "ETH-USDT",
    "type": "24H_VOLUME",
    "index": "RAILS",
    "value": "28513340.9400000105",
    "updatedAt": 1726171109083
  },
  {
    "market": "ETH-USDT",
    "type": "ASK",
    "index": "RAILS",
    "value": "2350.5038547",
    "updatedAt": 1726174865612
  },
  {
    "market": "ETH-USDT",
    "type": "BID",
    "index": "RAILS",
    "value": "2350.13526604",
    "updatedAt": 1726174865612
  },
  {
    "market": "ETH-USDT",
    "type": "FUNDING",
    "index": "RAILS",
    "value": "0.0000527105290972",
    "updatedAt": 1726167616514
  },
  {
    "market": "ETH-USDT",
    "type": "NEXT_FUNDING",
    "index": "RAILS",
    "value": "0.0000527105290972",
    "updatedAt": 1726167616514
  },
  {
    "market": "ETH-USDT",
    "type": "OPEN_INTEREST",
    "index": "RAILS",
    "value": "592.23030026",
    "updatedAt": 1726170313759
  }
]

Query Parameters

markets
string
required

Comma separated market names. Example value: BTC-USDT,ETH-USDT. To get all supported markets, call /api/v1/markets endpoint.

Response

200 - application/json
market
string
required

Market name. Example value: ETH-USDT. To get all supported markets, call /api/v1/markets endpoint.

type
enum<string>
required

Type of market data.

Available options:
INDEX,
ASK,
BID,
FUNDING,
NEXT_FUNDING,
OPEN_INTEREST,
24H_VOLUME,
24H_COUNT
index
enum<string>
required

Name of the index.

Available options:
CCIX,
CCCAGG,
HYPERLIQUID,
KRAKEN,
RAILS
value
string
required

The value for the given market data type and index.

updatedAt
number
required

Timestamp (milliseconds since epoch) when this value was last updated.