本文介绍Bitfinex APi

Platform Status

Get the current status of the platform. Maintenance periods last for just few minutes and might be necessary from time to time during upgrades of core components of our infrastructure. Even if rare it is important to have a way to notify users. For a real-time notification we suggest to use websockets and listen to events 20060/20061

 
 Try It

gethttps://api.bitfinex.com/v2/platform/status

Copy

curl https://api.bitfinex.com/v2/platform/status

Response Details

Fields Type Description
OPERATIVE int 1=operative, 0=maintenance

Maintenance mode

When the platform is marked in maintenance mode bots should stop trading activity. Cancelling orders will be still possible.

SUGGEST EDITS

Tickers

The ticker is a high level overview of the state of the market. It shows you the current best bid and ask, as well as the last trade price. It also includes information such as daily volume and how much the price has moved over the last day.

 
 Try It

gethttps://api.bitfinex.com/v2/tickers

Copy

curl https://api.bitfinex.com/v2/tickers?symbols=tBTCUSD,tLTCUSD,fUSD

curl https://api.bitfinex.com/v2/tickers?symbols=tBTCUSD

curl https://api.bitfinex.com/v2/tickers?symbols=ALL
200 OK400 Bad Request

[ // on trading pairs (ex. tBTCUSD) [ SYMBOL, BID, BID_SIZE, ASK, ASK_SIZE, DAILY_CHANGE, DAILY_CHANGE_PERC, LAST_PRICE, VOLUME, HIGH, LOW ], // on funding currencies (ex. fUSD) [ SYMBOL, FRR, BID, BID_SIZE, BID_PERIOD, ASK, ASK_SIZE, ASK_PERIOD, DAILY_CHANGE, DAILY_CHANGE_PERC, LAST_PRICE, VOLUME, HIGH, LOW ], ... ]

QUERY PARAMS

symbols

The symbols you want information about as a comma separated list, or ALL for every symbol. Ex:

Response Details

Fields Type Description
FRR float Flash Return Rate - average of all fixed rate funding over the last hour
BID float Price of last highest bid
BID_PERIOD int Bid period covered in days
BID_SIZE float Sum of the 25 highest bid sizes
ASK float Price of last lowest ask
ASK_PERIOD int Ask period covered in days
ASK_SIZE float Sum of the 25 lowest ask sizes
DAILY_CHANGE float Amount that the last price has changed since yesterday
DAILY_CHANGE_PERC float Amount that the price has changed expressed in percentage terms
LAST_PRICE float Price of the last trade
VOLUME float Daily volume
HIGH float Daily high
LOW float Daily low
SUGGEST EDITS

Ticker

The ticker is a high level overview of the state of the market. It shows you the current best bid and ask, as well as the last trade price. It also includes information such as daily volume and how much the price has moved over the last day.

 
 Try It

gethttps://api.bitfinex.com/v2/ticker/Symbol

Copy

curl https://api.bitfinex.com/v2/ticker/tBTCUSD
200 OK400 Bad Request

// on trading pairs (ex. tBTCUSD) [ BID, BID_SIZE, ASK, ASK_SIZE, DAILY_CHANGE, DAILY_CHANGE_PERC, LAST_PRICE, VOLUME, HIGH, LOW ] // on funding currencies (ex. fUSD) [ FRR, BID, BID_SIZE, BID_PERIOD, ASK, ASK_SIZE, ASK_PERIOD, DAILY_CHANGE, DAILY_CHANGE_PERC, LAST_PRICE, VOLUME, HIGH, LOW ]

PATH PARAMS

Symbol*

The symbol you want information about. You can find the list of valid symbols by calling the /symbols endpoint.

Response Details

Fields Type Description
FRR float Flash Return Rate - average of all fixed rate funding over the last hour
BID float Price of last highest bid
BID_PERIOD int Bid period covered in days
BID_SIZE float Sum of the 25 highest bid sizes
ASK float Price of last lowest ask
ASK_PERIOD int Ask period covered in days
ASK_SIZE float Sum of the 25 lowest ask sizes
DAILY_CHANGE float Amount that the last price has changed since yesterday
DAILY_CHANGE_PERC float Amount that the price has changed expressed in percentage terms
LAST_PRICE float Price of the last trade
VOLUME float Daily volume
HIGH float Daily high
LOW float Daily low
SUGGEST EDITS

Trades

Trades endpoint includes all the pertinent details of the trade, such as price, size and time.

 
 Try It

gethttps://api.bitfinex.com/v2/trades/Symbol/hist

Copy

curl https://api.bitfinex.com/v2/trades/tBTCUSD/hist
200 OK400 Bad Request

// on trading pairs (ex. tBTCUSD) [ [ ID, MTS, AMOUNT, PRICE ] ] // on funding currencies (ex. fUSD) [ [ ID, MTS, AMOUNT, RATE, PERIOD ] ]

PATH PARAMS

Symbol*

The symbol you want information about.

QUERY PARAMS

limit

Number of records

start

Millisecond start time

end

Millisecond end time

sort

if = 1 it sorts results returned with old > new

Response Details

Fields Type Description
MTS int millisecond time stamp
±AMOUNT float How much was bought (positive) or sold (negative).
PRICE float Price at which the trade was executed
RATE float Rate at which funding transaction occurred
PERIOD int Amount of time the funding transaction was for

The order that causes the trade determines if it is a buy or a sell.

SUGGEST EDITS

Books

The Order Books channel allow you to keep track of the state of the Bitfinex order book. It is provided on a price aggregated basis, with customizable precision.

 
 Try It

gethttps://api.bitfinex.com/v2/book/Symbol/Precision

Copy

curl https://api.bitfinex.com/v2/book/tBTCUSD/P0
200 OK400 Bad Request

// on trading pairs (ex. tBTCUSD) [ [ PRICE, COUNT, AMOUNT ] ] // on funding currencies (ex. fUSD) [ [ RATE, PERIOD, COUNT, AMOUNT ] ]

PATH PARAMS

Symbol*

The symbol you want information about. You can find the list of valid symbols by calling the /symbols endpoint.

Precision*

Level of price aggregation (P0, P1, P2, P3, P4, R0)

QUERY PARAMS

len

Number of price points ("25", "100")

Response Details

Fields Type Description
PRICE float Price level
RATE float Rate level
PERIOD float Period level (Funding only)
COUNT int Number of orders at that price level
±AMOUNT float Total amount available at that price level.

For Trading: if AMOUNT > 0 then bid else ask.
For Funding: if AMOUNT > 0 then ask else bid.

SUGGEST EDITS

Stats

Various statistics about the requested pair.

 
 Try It

gethttps://api.bitfinex.com/v2/stats1/Key:Size:Symbol/Section

200 OK400 Bad Request

// response with Section = "last"
[
MTS,
VALUE
]

// response with Section = "hist"
[
[ MTS, VALUE ],
...
]

PATH PARAMS

Key*

Allowed values: "funding.size", "credits.size", "credits.size.sym", "pos.size"

Size*

Available values: '1m'

Symbol*

The symbol you want information about.

Side*

Available values: "long", "short"

Section*

Available values: "last", "hist"

QUERY PARAMS

sort

if = 1 it sorts results returned with old > new

Response Details

Fields Type Description
MTS int millisecond timestamp
VALUE float Total amount

Available Keys

Key Description Arguments Example
pos.size Total Open Position (long / short) :1m :SYM_TRADING :SIDE pos.size:1m:tBTCUSD:long , pos.size:1m:tBTCUSD:short
funding.size Total Active Funding :1m :SYM_FUNDING funding.size:1m:fUSD
credits.size Active Funding used in positions :1m :SYM_FUNDING credits.size:1m:fUSD
credits.size.sym Active Funding used in positions (per trading symbol) :1m :SYM_FUNDING :SYM_TRADING credits.size.sym:1m:fUSD:tBTCUSD
SUGGEST EDITS

Candles

Provides a way to access charting candle info

 
 Try It

gethttps://api.bitfinex.com/v2/candles/trade:TimeFrame:Symbol/Section

200 OK400 Bad Request

// response with Section = "last"
[
MTS,
OPEN,
CLOSE,
HIGH,
LOW,
VOLUME
]

// response with Section = "hist"
[
[ MTS, OPEN, CLOSE, HIGH, LOW, VOLUME ],
...
]

PATH PARAMS

TimeFrame*

Available values: '1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1D', '7D', '14D', '1M'

Symbol*

The symbol you want information about.

Section*

Available values: "last", "hist"

QUERY PARAMS

limit

Number of candles requested

start

Filter start (ms)

end

Filter end (ms)

sort

if = 1 it sorts results returned with old > new

Response Details

Fields Type Description
MTS int millisecond time stamp
OPEN float First execution during the time frame
CLOSE float Last execution during the time frame
HIGH float Highest execution during the time frame
LOW float Lowest execution during the timeframe
VOLUME float Quantity of symbol traded within the timeframe

Available Keys

Key Description Arguments Example
trade Trading Candles :TF :SYM_TRADING trade :1m :tBTCUSD
trade Funding Candles :TF :SYM_FUNDING:pPERIOD trade :1m :fUSD :p30
trade Aggregate Funding Candles (AGGR=[10,30]) :TF :SYM_FUNDING :aAGGR :pPER_START :p :PER_END trade :1m :fUSD :a10 :p2 :p10 , trade :1m :fUSD :a10 :p11 :p20 , trade :1m :fUSD :a10 :p21 :p30 , trade :1m :fUSD :a30 :p2 :p30
SUGGEST EDITS

Market Average Price

Calculate the average execution rate for Trading or Margin funding.

 
 Try It

posthttps://api.bitfinex.com/v2/calc/trade/avg

Copy

curl --request POST \
  --url 'https://api.bitfinex.com/v2/calc/trade/avg?symbol=symbol'
200 OK400 Bad Request

[RATE_AVG, AMOUNT]

QUERY PARAMS

symbol*

The symbol you want information about.

amount

Amount. Positive for buy, negative for sell (ex. "1.123")

period

(optional) Maximum period for Margin Funding

rate_limit

Limit rate/price (ex. "1000.5")

 

Bitfinex API的更多相关文章

  1. 各大知名区块链交易所链接及API文档链接

    区块链交易所链接 火币网(Huobi):https://www.huobi.br.com/zh-cn/ API文档:https://github.com/huobiapi/API_Docs/wiki ...

  2. 干货来袭-整套完整安全的API接口解决方案

    在各种手机APP泛滥的现在,背后都有同样泛滥的API接口在支撑,其中鱼龙混杂,直接裸奔的WEB API大量存在,安全性令人堪优 在以前WEB API概念没有很普及的时候,都采用自已定义的接口和结构,对 ...

  3. 12306官方火车票Api接口

    2017,现在已进入春运期间,真的是一票难求,深有体会.各种购票抢票软件应运而生,也有购买加速包提高抢票几率,可以理解为变相的黄牛.对于技术人员,虽然写一个抢票软件还是比较难的,但是还是简单看看123 ...

  4. 几个有趣的WEB设备API(二)

    浏览器和设备之间还有很多有趣的接口, 1.屏幕朝向接口 浏览器有两种方法来监听屏幕朝向,看是横屏还是竖屏. (1)使用css媒体查询的方法 /* 竖屏 */ @media screen and (or ...

  5. html5 canvas常用api总结(三)--图像变换API

    canvas的图像变换api,可以帮助我们更加方便的绘画出一些酷炫的效果,也可以用来制作动画.接下来将总结一下canvas的变换方法,文末有一个例子来更加深刻的了解和利用这几个api. 1.画布旋转a ...

  6. JavaScript 对数据处理的5个API

    JavaScript对数据处理包括向上取整.向下取整.四舍五入.固定精度和固定长度5种方式,分别对应ceil,floor,round,toFixed,toPrecision等5个API,本文将对这5个 ...

  7. ES5对Array增强的9个API

    为了更方便的对Array进行操作,ES5规范在Array的原型上新增了9个方法,分别是forEach.filter.map.reduce.reduceRight.some.every.indexOf ...

  8. javascript的api设计原则

    前言 本篇博文来自一次公司内部的前端分享,从多个方面讨论了在设计接口时遵循的原则,总共包含了七个大块.系卤煮自己总结的一些经验和教训.本篇博文同时也参考了其他一些文章,相关地址会在后面贴出来.很难做到 ...

  9. 一百元的智能家居——Asp.Net Mvc Api+讯飞语音+Android+Arduino

    大半夜的,先说些废话提提神 如今智能家居已经不再停留在概念阶段,高大上的科技公司都已经推出了自己的部分或全套的智能家居解决方案,不过就目前的现状而言,大多还停留在展厅阶段,还没有广泛的推广起来,有人说 ...

随机推荐

  1. 利用广播实现ip拨号——示例

    1.创建activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/androi ...

  2. js精准时间迭代器(定时器)

    /** * 精准时间迭代器 * Create By Tujia @2017.05.22 * * 使用示例: * window.setMyInterval(function(){ * console.l ...

  3. windows应急响应入侵排查思路

    0x00 前言 ​ 当企业发生黑客入侵.系统崩溃或其它影响业务正常运行的安全事件时,急需第一时间进行处理,使企业的网络信息系统在最短时间内恢复正常工作,进一步查找入侵来源,还原入侵事故过程,同时给出解 ...

  4. Android涉及到的网址都记录在这把~~~~

    http://source.android.com/source/initializing.html  开放源码 http://developer.android.com/about/versions ...

  5. Unity3d OnApplicationPause与OnApplicationFocus

    在手机游戏当中,会碰到“强制暂停”,如:锁屏.接电话或短信之类的.如果“强制暂停”时间过长,网络游戏有时得重新登录等事件. 而Unity3d,Android Plugins中的UnityPlayer. ...

  6. 如何在Windows系统上利用Telnet协议连接Linux服务器

    Telnet协议是Internet远程登录服务的标准协议,它为用户提供了在本地计算机上完成远程主机工作的能力.很多终端使用者都习惯在计算机上利用Telnet会话来远程控制服务器.这里小编就分两步为大家 ...

  7. 基础知识《十一》Java异常处理总结

    Java异常处理总结           异常处理是程序设计中一个非常重要的方面,也是程序设计的一大难点,从C开始,你也许已经知道如何用if...else...来控制异常了,也许是自发的,然而这种控制 ...

  8. 【大数据系列】hive安装及启动

    一.安装好jdk和hadoop 二.下载apache-hive https://mirrors.tuna.tsinghua.edu.cn/apache/hive/hive-2.3.0/ 三.解压到安装 ...

  9. 【ORACLE 】查询被锁住的对象,并结束其会话

    使用Oracle时,发现有表被锁,又不知道是谁(或者哪个程序)锁的,怎么办 ? 两步走: 1.查找出被锁对象的会话ID和序列号 执行如下SQL: -- 查询出被锁对象,并提供 kill 脚本 SELE ...

  10. 第二步 (仅供参考) sencha touch 使用cmd打包apk

    最新版本的cmd可以直接将sencha touch项目打包成本地应用,不过还有很多不足,本文仅供参考 通过sencha app build native命令可以直接将项目打包成本地应用,不过在命令运行 ...