Comments (2)
Hello YZhao, sorry for the delay.
I've prepared an example code snippet for you
import asyncio
from bfxapi import Client
async def example():
bfx = Client()
data = await bfx.rest.get_public_stats(
"pos.size", "1m", 'tBTCUSD', "hist", "long"
)
print(data)
t = asyncio.ensure_future(example())
asyncio.get_event_loop().run_until_complete(t)
Output
[[1668789000000, 106432.57017588], [1668788940000, 106432.57017588], [1668788880000, 106432.44957314], [1668788820000, 106432.45039416], [1668788760000, 106432.70030638], [1668788700000, 106432.78555592], [1668788640000, 106432.84044877], [1668788580000, 106432.8600154], [1668788520000, 106430.8000145], [1668788460000, 106430.8000145], [1668788400000, 106426.56542111], [1668788340000, 106423.87252514], [1668788280000, 106423.85551825], [1668788220000, 106423.16270861], [1668788160000, 106422.69770973], [1668788100000, 106422.69770973], [1668788040000, 106422.69270973], [1668787980000, 106422.69270973], [1668787920000, 106422.69270973], [1668787860000, 106422.68770973], [1668787800000, 106422.68770973], [1668787740000, 106422.68770973], [1668787680000, 106422.68770973], [1668787620000, 106422.68770973], [1668787560000, 106422.66270973], [1668787500000, 106422.66270973], [1668787440000, 106422.66270973], [1668787380000, 106424.82428507], [1668787320000, 106424.72428507], [1668787260000, 106423.28710826], [1668787200000, 106423.28710826], [1668787140000, 106423.27210826], [1668787080000, 106423.27210826], [1668787020000, 106423.27210826], [1668786960000, 106423.32209828], [1668786900000, 106422.45946907], [1668786840000, 106422.46346454], [1668786780000, 106422.46246454], [1668786720000, 106422.46246454], [1668786660000, 106422.46246454], [1668786600000, 106422.45846454], [1668786540000, 106422.45846454], [1668786480000, 106422.45846454], [1668786420000, 106422.45846454], [1668786360000, 106422.35175214], [1668786300000, 106422.35722167], [1668786240000, 106422.35722167], [1668786180000, 106422.28116629], [1668786120000, 106422.28516629], [1668786060000, 106422.28901629], [1668786000000, 106422.28901629], [1668785940000, 106421.55380786], [1668785880000, 106421.55380786], [1668785820000, 106421.55979406], [1668785760000, 106421.55979406], [1668785700000, 106421.55979406], [1668785640000, 106421.55979406], [1668785580000, 106421.55979406], [1668785520000, 106421.56479406], [1668785460000, 106421.53979406], [1668785400000, 106421.55578026], [1668785340000, 106421.54078026], [1668785280000, 106421.55578026], [1668785220000, 106421.26556026], [1668785160000, 106421.2880864], [1668785100000, 106421.27477238], [1668785040000, 106421.27484579], [1668784980000, 106421.27484579], [1668784920000, 106421.26754813], [1668784860000, 106421.26754813], [1668784800000, 106421.26954813], [1668784740000, 106421.03276133], [1668784680000, 106419.79097453], [1668784620000, 106419.30949206], [1668784560000, 106416.07996572], [1668784500000, 106416.09015821], [1668784440000, 106416.09496572], [1668784380000, 106416.32375116], [1668784320000, 106416.37172957], [1668784260000, 106416.26018241], [1668784200000, 106416.10312241], [1668784140000, 106416.10321189], [1668784080000, 106416.17829508], [1668784020000, 106416.16530508], [1668783960000, 106416.16330508], [1668783900000, 106416.1849284], [1668783840000, 106416.22895292], [1668783780000, 106414.75246082], [1668783720000, 106414.72628302], [1668783660000, 106414.71528387], [1668783600000, 106414.76528387], [1668783540000, 106415.21497041], [1668783480000, 106415.21497041], [1668783420000, 106415.21503976], [1668783360000, 106415.21503976], [1668783300000, 106415.14003976], [1668783240000, 106414.84314316], [1668783180000, 106414.83814316], [1668783120000, 106414.83334296], [1668783060000, 106414.97928496], [1668783000000, 106414.83257256], [1668782940000, 106414.82903416], [1668782880000, 106414.92403416], [1668782820000, 106414.80361416], [1668782760000, 106414.83061416], [1668782700000, 106414.75320251], [1668782640000, 106414.65035904], [1668782580000, 106416.46844789], [1668782520000, 106416.50887128], [1668782460000, 106416.50942966], [1668782400000, 106415.99377468], [1668782340000, 106416.00677468], [1668782280000, 106416.90811427], [1668782220000, 106416.96211427], [1668782160000, 106416.96711427], [1668782100000, 106418.57330547], [1668782040000, 106420.50744045], [1668781980000, 106420.54203058], [1668781920000, 106417.51869374], [1668781860000, 106418.56922667]]
from bitfinex-api-py.
To get the volume I suggest to directly query
https://api-pub.bitfinex.com/v2/stats1/vol.1d:30m:BFX/hist
import requests
data = requests.get('https://api-pub.bitfinex.com/v2/stats1/vol.1d:30m:BFX/hist').json()
from bitfinex-api-py.
Related Issues (20)
- 'Fatal error on SSL protocol' when use uvloop
- API is missing candle data HOT 4
- Rest API missing Liquidations implementation HOT 2
- Python 3.10 Support HOT 2
- Unable to create order on paper account: [ERROR] Notification ERROR: action: disabled HOT 1
- Not working with python3.10 asyncio HOT 2
- Unknown data event: '[0.79816, 0, 1]' [54, [0.79816, 0, 1]] HOT 1
- How to get more data in public orderbook? HOT 1
- New pyee version
- Candle data from wss is delayed behind rest HOT 1
- bfx.rest.auth.cancel_order_multi HOT 1
- Failing "import bfxapi" HOT 2
- How come I can't call this endpoint: get_derivatives_status_history
- Starting from version 3.0.0b3, the meta parameter is no longer present in the submit_order function. HOT 1
- Christina vongphit
- How to setup logging? HOT 1
- "TypeError: constraints must be a tuple" when importing bfxapi in Python 3.12.2 HOT 2
- No "ou" received when order completes (fully filled) HOT 1
- Importing bfxapi results in a segfault HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitfinex-api-py.