GET
/
exchanges
/
List exchanges
curl --request GET \
  --url https://api.rulebookcompany.com/api/v1/exchanges/ \
  --header 'x-rulebook-api-access-key: <api-key>'
import requests

url = "https://api.rulebookcompany.com/api/v1/exchanges/"

headers = {"x-rulebook-api-access-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-rulebook-api-access-key': '<api-key>'}};

fetch('https://api.rulebookcompany.com/api/v1/exchanges/', 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.rulebookcompany.com/api/v1/exchanges/",
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-rulebook-api-access-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://api.rulebookcompany.com/api/v1/exchanges/"

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

req.Header.Add("x-rulebook-api-access-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://api.rulebookcompany.com/api/v1/exchanges/")
.header("x-rulebook-api-access-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.rulebookcompany.com/api/v1/exchanges/")

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

request = Net::HTTP::Get.new(url)
request["x-rulebook-api-access-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing or invalid API key."
  },
  "meta": { "query_time_ms": 1 }
}

Overview

Returns all exchanges available to your account. Each exchange includes a summary of available fee types and the total record count. Use this as your starting point to discover what data you can query.
Authorization Required - Include your API key in the x-rulebook-api-access-key header. Contact aaron@rulebookcompany.com to obtain access.

Request

curl -X GET https://api.rulebookcompany.com/api/v1/exchanges/ \
  -H "x-rulebook-api-access-key: YOUR_API_KEY"

Response

data
array
Array of exchange objects
meta
object
Response metadata

Example Response

{
  "data": [
    {
      "name": "nasdaq",
      "display_name": "Nasdaq Stock Exchange",
      "fee_types": ["option"],
      "record_count": 512
    },
    {
      "name": "nasdaq_phlx",
      "display_name": "Nasdaq Stock Exchange PHLX",
      "fee_types": ["option"],
      "record_count": 2383
    },
    {
      "name": "nasdaq_ise",
      "display_name": "Nasdaq Stock Exchange ISE",
      "fee_types": ["option"],
      "record_count": 1534
    },
    {
      "name": "nasdaq_gemx",
      "display_name": "Nasdaq Stock Exchange GEMX",
      "fee_types": ["option"],
      "record_count": 616
    },
    {
      "name": "nasdaq_mrx",
      "display_name": "Nasdaq Stock Exchange MRX",
      "fee_types": ["option"],
      "record_count": 864
    },
    {
      "name": "nasdaq_texas",
      "display_name": "Nasdaq Stock Exchange Texas",
      "fee_types": ["option"],
      "record_count": 864
    }
  ],
  "meta": {
    "record_count": 6,
    "query_time_ms": 67
  }
}

Next Steps

After listing exchanges, call Get Exchange Details to see all available filter values for a specific exchange, or go directly to List Fee Schedule Results to start querying data.

Error Responses

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing or invalid API key."
  },
  "meta": { "query_time_ms": 1 }
}

Authorizations

x-rulebook-api-access-key
string
header
required

API access key provided by Rulebook Company. Contact aaron@rulebookcompany.com to obtain one.

Response

List of exchanges

data
object[]
meta
object

Metadata for non-paginated responses