与BitCoinAverage API集成的库

bitcoinaverage的Python项目详细描述


BitcoinAverage PIP库

这里我们提供两个示例-第一个示例显示如何调用函数,该函数向restful api发出http请求,另一个示例连接到一个websocket。您只需要输入您的公钥和密钥,就可以运行此示例了。

官方文件:https://apiv2.bitcoinaverage.com 关于github的更多示例:https://github.com/bitcoinaverage/api-integration-examples/

http示例

#!python

from bitcoinaverage import RestfulClient

if __name__ == '__main__':
    public_key = 'your_public_key'
    secret_key = 'your_secret_key'

    restful_client = RestfulClient(secret_key, public_key)

    ticker_global_per_symbol = restful_client.ticker_global_per_symbol('BTCUSD')
    print('Global Ticker for BTCUSD:')
    print(ticker_global_per_symbol)

WebSocket v1示例

#!python

from bitcoinaverage import TickerWebsocketClient

if __name__ == '__main__':
    public_key = 'your_public_key'
    secret_key = 'your_secret_key'

    print('Connecting to the ticker websocket...')
    ws = TickerWebsocketClient(public_key, secret_key)
    ws.ticker_data('local', 'BTCUSD')

WebSocket v2示例

版本2 WebSocket客户端分别接受加密货币列表和交换列表。 他们还使用新的优化算法,以更快的更新。

股票代码

#!python

from bitcoinaverage import TickerWebsocketClientV2

if __name__ == '__main__':
    public_key = 'your_public_key'
    secret_key = 'your_secret_key'

    print('Connecting to the ticker websocket...')
    ws = TickerWebsocketClientV2(public_key, secret_key)
    ws.ticker_data('local', ['BTCUSD', 'ETHUSD'])

交换

#!python

from bitcoinaverage import ExchangeWebsocketClientV2

if __name__ == '__main__':
    public_key = 'your_public_key'
    secret_key = 'your_secret_key'

    print('Connecting to the exchange websocket...')
    ws = ExchangeWebsocketClientV2(public_key, secret_key)
    ws.ticker_data(['bitstamp', 'gdax'])

版权区块链数据有限公司

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
带truezip的java拆分zip   java Spring,AppEngine:在AppEngine的数据源中添加postgresql url   java Android coverflow   java以编程方式创建复合过滤器,以在log4j 2中定义多个过滤器   java jpa eclipselink异常[eclipselink 4002]   中的java WordNet数据库目录相对路径。罐子   java无法在Spring Boot 2/3中显示登录的用户   java Onetomany:未找到联接表错误   java数据模型演化   java方法在类型列表中添加的(对象)不适用于参数(int)意味着什么?   用java打印两个数组   java SNMP4J发送从不超时   java添加/删除联系人(EditText)+类别(SpinnerBox),可以根据需要动态添加/删除多个联系人   语句和PreparedStatement之间的java差异   java在运行作为JAR归档文件分发的项目时加载图像等资源   来自应用程序或外部服务器的java Cron作业   多线程Java并发:并发添加和清除列表项   java更改单元测试的私有方法行为