Get the history of long and short position quantities in BTC and ETH margin (leveraged) trading on Bitfinex, returned per interval and measured in number of coins. Useful for observing the long/short direction of leveraged capital on Bitfinex.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Available on all API plans: Hobbyist Startup Standard Professional Enterprise
The data intervals you can query differ by API plan; see API Plans and Available Intervals below on this page.
Response Data
data is an array; each element holds the data for one interval, sorted from oldest to newest. time is the start time of the interval, in seconds; the last element corresponds to an interval that has not yet closed. Long and short positions are returned as a number of coins (e.g., the number of BTC when symbol=BTC).
The returnedtimeis in seconds
timeis a 10-digit timestamp in seconds (e.g.,1792465200), unlike the millisecond timestamps of most endpoints; multiply it by 1000 before converting it to a date.
Start and end time parametersFor now, please do not pass
start_timeorend_time; if they are omitted, the endpoint returns the most recentlimitdata points. When you need data for a specific period, control the number of data points withlimit, then filter locally by the returnedtime.
200 · application/json · See the response example in the right panel.
| Field | Type | Always Returned | Description |
|---|---|---|---|
code | string | Yes | Business status code; "0" means success |
msg | string | No | Result message; not returned on success |
data | array of object | Yes | Array sorted by time; each element is one interval |
data[].time | integer | Yes | Interval start time, timestamp in seconds (UTC) |
data[].long_quantity | number | Yes | Bitfinex margin long position quantity, in number of coins |
data[].short_quantity | number | Yes | Bitfinex margin short position quantity, in number of coins |
API Plans and Available Intervals
All API plans can call this endpoint; they differ in the data intervals they can query: the lower the plan, the longer the shortest available interval. For the price of each plan, see API Plans.
| API Plan | Access | Available Data Intervals (interval Parameter) |
|---|---|---|
| Hobbyist | ✅ Yes | 4 hours and above: 4h, 6h, 8h, 12h, 1d |
| Startup | ✅ Yes | 30 minutes and above: 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d |
| Standard | ✅ Yes | All intervals, minimum 1 minute (1m) |
| Professional | ✅ Yes | All intervals, minimum 1 minute (1m) |
| Enterprise | ✅ Yes | All intervals, minimum 1 minute (1m) |
For how much historical data each interval can query, see Intervals.
Use This Endpoint with AI
Pick a task and click Open in ChatGPT or Open in Claude: the AI reads this page first and then gives you the result. You can also click Copy and paste the full prompt into the AI tool you use.
This endpoint provides data through the REST API. Use the prompts above to have AI write the request code. For the tools available through MCP, see CoinGlass MCP.
Use Cases
| Scenario | Description |
|---|---|
| Track Leveraged Capital Direction | Track increases and decreases in Bitfinex margin long and short positions, which the market often treats as a reference for the moves of large capital. |
| Long/Short Ratio Calculation | Divide the long quantity by the short quantity to get the long/short ratio and observe how the balance between longs and shorts changes. |
| Short Squeeze Risk | If the price rises after short positions have increased rapidly, it may trigger short covering and amplify the rally. |
| Compare with Price | Align by time with Spot Pair Price OHLC History to judge whether leveraged capital is trading with or against the trend. Note that time in this endpoint is in seconds. |
Related Endpoints
| Endpoint | How It Differs |
|---|---|
| Borrow Interest Rate | Interest rate history of margin borrowing on exchanges |
| Coinbase Premium Index | Bitcoin price gap between Coinbase and Binance |
| Top Trader Long/Short Position Ratio History | Long/short position ratio of top traders in the futures market |
| Global Long/Short Account Ratio History | Ratio of long to short accounts in the futures market |
FAQ
What unit is long_quantity in?
Number of coins. For example, when symbol=BTC, 89643.07 means a margin long position of about 89,600 BTC.
How do I get data for a specific period?
If you omit start_time and end_time, the endpoint returns the most recent limit data points, sorted from oldest to newest, with the last one being an interval that has not yet closed; for example, with interval=1h and limit=2, it returns data for the 2 most recent hourly intervals. For now, please do not pass start and end times; use limit to get enough data, then slice it locally by time.
Why is time a 10-digit number?
The time returned by this endpoint is a timestamp in seconds; multiply it by 1000 before converting it to a date. For how to convert, see Timestamps and Pagination.
Which coins are supported?
BTC and ETH. The endpoint combines symbol and quoteAsset (default USD) into a market code and queries the BTCUSD and ETHUSD markets on Bitfinex. symbol has no default value, so pass it every time.
Learn More: Bitfinex Margin Long/Short Positions
What Are Bitfinex Margin Long/Short Positions?
Bitfinex offers spot margin (leveraged) trading, where users can borrow money to go long or borrow coins to go short. This endpoint counts the quantities of long and short positions in this margin trading; the data comes from Bitfinex.
Why Does the Market Watch Bitfinex Long/Short Positions?
Bitfinex was one of the earlier exchanges to offer margin trading, and large changes in its margin long or short positions are often treated by the market as a reference for large capital changing direction.
How Is This Different from the Futures Long/Short Ratio?
This endpoint gives position quantities in spot margin trading, in coins; the long/short ratio in the futures market reflects the long/short proportion of futures accounts or positions, see Top Trader Long/Short Position Ratio History.
