Get order book
curl --request POST \
--url https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_id": "BTC-USD"
}
'import requests
url = "https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book"
payload = { "product_id": "BTC-USD" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({product_id: 'BTC-USD'})
};
fetch('https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book', 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.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'product_id' => 'BTC-USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book"
payload := strings.NewReader("{\n \"product_id\": \"BTC-USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": \"BTC-USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": \"BTC-USD\"\n}"
response = http.request(request)
puts response.read_body{
"ask_levels_total": 18058,
"asks": [
{
"num_orders": 1,
"price": "84509.59",
"size": "0.11833712"
},
{
"num_orders": 1,
"price": "84511.76",
"size": "0.09466139"
},
{
"num_orders": 1,
"price": "84512.37",
"size": "0.11833712"
}
],
"auction": null,
"auction_mode": false,
"bid_levels_total": 22830,
"bids": [
{
"num_orders": 1,
"price": "84507.92",
"size": "0.0992"
},
{
"num_orders": 1,
"price": "84506.92",
"size": "0.03859996"
},
{
"num_orders": 2,
"price": "84505.9",
"size": "0.10976422"
}
],
"depth": 3,
"level": 2,
"observed_at_ms": 1790268816893,
"product_id": "BTC-USD",
"sequence": 136712854999,
"source_url": "https://api.exchange.coinbase.com/products/BTC-USD/book?level=2",
"time": "2026-09-24T16:53:34.584522415Z",
"truncated": true
}Coinbase Exchange
Get order book
Liquidity and spread at a point in time; use depth to bound the payload.
POST
https://api.aisa.one
/
apis
/
v1
/
api-exchange-coinbase-com
/
markets
/
get-order-book
Get order book
curl --request POST \
--url https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product_id": "BTC-USD"
}
'import requests
url = "https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book"
payload = { "product_id": "BTC-USD" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({product_id: 'BTC-USD'})
};
fetch('https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book', 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.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'product_id' => 'BTC-USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book"
payload := strings.NewReader("{\n \"product_id\": \"BTC-USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": \"BTC-USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": \"BTC-USD\"\n}"
response = http.request(request)
puts response.read_body{
"ask_levels_total": 18058,
"asks": [
{
"num_orders": 1,
"price": "84509.59",
"size": "0.11833712"
},
{
"num_orders": 1,
"price": "84511.76",
"size": "0.09466139"
},
{
"num_orders": 1,
"price": "84512.37",
"size": "0.11833712"
}
],
"auction": null,
"auction_mode": false,
"bid_levels_total": 22830,
"bids": [
{
"num_orders": 1,
"price": "84507.92",
"size": "0.0992"
},
{
"num_orders": 1,
"price": "84506.92",
"size": "0.03859996"
},
{
"num_orders": 2,
"price": "84505.9",
"size": "0.10976422"
}
],
"depth": 3,
"level": 2,
"observed_at_ms": 1790268816893,
"product_id": "BTC-USD",
"sequence": 136712854999,
"source_url": "https://api.exchange.coinbase.com/products/BTC-USD/book?level=2",
"time": "2026-09-24T16:53:34.584522415Z",
"truncated": true
}Request contract
- Method and path: POST /apis/v1/api-exchange-coinbase-com/markets/get-order-book
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-order-book
{
"operationId": "api-exchange-coinbase-com.markets.get-order-book",
"method": "POST",
"path": "/apis/v1/api-exchange-coinbase-com/markets/get-order-book",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"examples": {
"provider": {
"summary": "Official provider example; checked against AIsa request constraints",
"value": {
"depth": 3,
"level": 2,
"product_id": "BTC-USD"
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"depth": {
"default": 50,
"description": "Maximum price levels per side to return for level 2 (level 1 always has one).\n\nProvider reference: minimum 1; maximum 1000; default 50.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"max": 1000,
"min": 1
}
},
"level": {
"default": 1,
"description": "1 = best bid/ask only (default); 2 = aggregated book truncated to `depth`.\n\nProvider reference: allowed values [\"1\", \"2\"]; default 1.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"1",
"2"
]
}
},
"product_id": {
"description": "Trading pair id `BASE-QUOTE` as listed by `list_products`, e.g. `BTC-USD`, `USELESS-USD`. Case-insensitive; the canonical upper-case id is returned. Pattern: ^[A-Za-z0-9]{1,20}-[A-Za-z0-9]{1,20}$.",
"type": "string"
}
},
"required": [
"product_id"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Usage-based pricing. Default request estimate: $0.0005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.Authorizations
Body
application/json
Response
Aggregated order book for one trading pair (GET /products/{product_id}/book?level=1|2). Level 1 is the best bid and ask only; level 2 is the full aggregated book (thousands of price levels), truncated client-side to depth levels per side, best first. Level 3 (every individual order, ~6 MB) is not exposed.
The response contains the tool result directly.
| Documented field | Provider type | Description |
|---|---|---|
ask_levels_total | number | Price levels the exchange returned on the ask side before truncation. |
asks | object[] | Best ask first. |
auction | object | The exchange's auction block when a product is in auction mode; passed through unchanged, null otherwise. |
auction_mode | boolean | |
bid_levels_total | number | Price levels the exchange returned on the bid side before truncation. |
bids | object[] | Best bid first. |
depth | number | Depth applied per side. |
level | number | |
observed_at_ms | number | Milliseconds since the Unix epoch when this call ran. |
product_id | string | |
sequence | number | Exchange book sequence number. |
source_url | string | The upstream request URL this record was shaped from. |
time | string | Book snapshot time, RFC 3339 UTC; null when the exchange omits it. |
truncated | boolean | True when either side was cut to depth. |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.