Get Long Short Ratio Data
curl --request GET \
--url https://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio \
--header 'X-API-Key: <api-key>'import requests
url = "https://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio', 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://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio",
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-API-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://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-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://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"long_account_ratio": 123,
"long_short_ratio": 123,
"short_account_ratio": 123,
"symbol": "<string>",
"time": "<string>",
"timestamp": 123
}
],
"error": {
"code": "RESOURCE_NOT_FOUND",
"details": [
{
"field": "<string>",
"got": "<string>",
"reason": "<string>"
}
],
"docs_url": "<string>",
"examples": [
"<string>"
],
"hint": "<string>",
"message": "The requested resource was not found.",
"suggestions": [
"<string>"
]
},
"metadata": "<unknown>",
"pagination": "<unknown>",
"request_id": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"details": [
{
"field": "<string>",
"got": "<string>",
"reason": "<string>"
}
],
"docs_url": "<string>",
"examples": [
"<string>"
],
"hint": "<string>",
"message": "The requested resource was not found.",
"suggestions": [
"<string>"
]
},
"metadata": "<unknown>",
"pagination": "<unknown>",
"request_id": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"details": [
{
"field": "<string>",
"got": "<string>",
"reason": "<string>"
}
],
"docs_url": "<string>",
"examples": [
"<string>"
],
"hint": "<string>",
"message": "The requested resource was not found.",
"suggestions": [
"<string>"
]
},
"metadata": "<unknown>",
"pagination": "<unknown>",
"request_id": "<string>",
"success": true
}Crypto
Get Long Short Ratio Data
Feature Overview OpenAPI JSON Spec Get long short ratio data for a specific trading pair symbol with time range filtering.
Main Use Cases
- Market Sentiment Analysis: Track the ratio of long to short positions over time
- Trading Strategy: Use long/short ratio as a contrarian or confirmation indicator
- Risk Management: Monitor extreme positioning in the market
- Technical Analysis: Combine with price action for comprehensive analysis
Query Parameters & Logic
Required Parameters:
symbol: Trading pair symbol (e.g., BTCUSDT)start_time: Start timestamp (Unix seconds)end_time: End timestamp (Unix seconds)
Optional Parameters:
limit: Maximum number of results to return (1-1000, default: 30)exchange: Exchange name (only “binance” supported, default: binance)interval: Time interval (only “1d” supported, default: 1d)
Supported Intervals:
1d: 1-day intervals (default)
Validation Rules:
- Symbol is required and must be a valid trading pair
- start_time must be before end_time
- Limit defaults to 30 if not provided, max 1000
- Exchange defaults to “binance” if not provided
- Interval defaults to “1d” if not provided
Response Data Structure
data([]LongShortRatioData): Array of long short ratio data points (latest first, reverse chronological order)count(int32): Actual number of data points returned (0-1000)latest_time(string): Timestamp of the most recent data point (Unix seconds as string)
LongShortRatioData fields:
symbol(string): Trading pair symbol (e.g., “BTCUSDT”)long_short_ratio(string): Long/Short ratio in string format (e.g., “2.2798” means 2.28:1 long:short)long_account_ratio(number): Long account proportion (e.g., 0.65 means 65% of accounts are long; 0 when source data is missing)short_account_ratio(number): Short account proportion (e.g., 0.35 means 35% of accounts are short; 0 when source data is missing)timestamp(string): Unix timestamp in seconds as string (e.g., “1763978100”)
Data Interpretation:
- longShortRatio > 1.0: More accounts are long (bullish sentiment)
- longShortRatio = 1.0: Equal long and short positions (neutral)
- longShortRatio < 1.0: More accounts are short (bearish sentiment)
Usage Examples
- Minimal request (uses defaults):
?symbol=BTCUSDT&start_time=1733270400&end_time=1733356800 - With custom limit:
?symbol=BTCUSDT&start_time=1733270400&end_time=1733356800&limit=100 - Full parameters:
?symbol=BTCUSDT&start_time=1733270400&end_time=1733356800&limit=100&interval=5min&exchange=binance
Important Notes
- All required parameters must be provided
- Results are ordered by timestamp in descending order (latest first)
- Higher long/short ratio indicates more bullish sentiment
- Data is provided in 1-day intervals (1d)
GET
/
v1
/
crypto
/
long-short-ratio
Get Long Short Ratio Data
curl --request GET \
--url https://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio \
--header 'X-API-Key: <api-key>'import requests
url = "https://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio', 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://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio",
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-API-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://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-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://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-tools.prd.arrays.org/api/v1/crypto/long-short-ratio")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"long_account_ratio": 123,
"long_short_ratio": 123,
"short_account_ratio": 123,
"symbol": "<string>",
"time": "<string>",
"timestamp": 123
}
],
"error": {
"code": "RESOURCE_NOT_FOUND",
"details": [
{
"field": "<string>",
"got": "<string>",
"reason": "<string>"
}
],
"docs_url": "<string>",
"examples": [
"<string>"
],
"hint": "<string>",
"message": "The requested resource was not found.",
"suggestions": [
"<string>"
]
},
"metadata": "<unknown>",
"pagination": "<unknown>",
"request_id": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"details": [
{
"field": "<string>",
"got": "<string>",
"reason": "<string>"
}
],
"docs_url": "<string>",
"examples": [
"<string>"
],
"hint": "<string>",
"message": "The requested resource was not found.",
"suggestions": [
"<string>"
]
},
"metadata": "<unknown>",
"pagination": "<unknown>",
"request_id": "<string>",
"success": true
}{
"data": "<unknown>",
"error": {
"code": "RESOURCE_NOT_FOUND",
"details": [
{
"field": "<string>",
"got": "<string>",
"reason": "<string>"
}
],
"docs_url": "<string>",
"examples": [
"<string>"
],
"hint": "<string>",
"message": "The requested resource was not found.",
"suggestions": [
"<string>"
]
},
"metadata": "<unknown>",
"pagination": "<unknown>",
"request_id": "<string>",
"success": true
}Authorizations
API Key authentication. Example: "your-api-key-here"
Query Parameters
Crypto token symbol (e.g., BTC, ETH, SOL)
Start timestamp (Unix seconds)
End timestamp (Unix seconds)
Maximum number of results (1-1000, default: 30)
Exchange name (only binance supported, default: binance)
Available options:
binance Time interval (only 1d supported, default: 1d)
Available options:
1d 
