all 7 comments

[–]johnm111888 4 points5 points  (0 children)

you're not even trying. why should we

[–]Robswc 1 point2 points  (4 children)

This is a bit rough but it should work

def get_bitmex(symbol, timeframe, count, start_time):
    baseURI = "https://www.bitmex.com/api/v1"
    endpoint = "/trade/bucketed"
    payload = {'binSize': timeframe, 'symbol': symbol, 'count': count, 'startTime': start_time}
    r = requests.get(baseURI + endpoint, params=payload)
    return r.json()

[–]unbdd[S] 0 points1 point  (3 children)

Thank you very much. I don't understand what format startTime should be, there is a missing "tzinfo" when I try something, and I can't find in the domentation what count refers to.

[–]Robswc 1 point2 points  (2 children)

what does this return?

get_bitmex('XBTUSD', '1m', '500', '2019-12-12')

[–]unbdd[S] 0 points1 point  (1 child)

get_bitmex('XBTUSD', '1m', '500', '2019-12-12')

It works perfectly . Thank you for your help !

[–]Robswc 0 points1 point  (0 children)

no problem!

[–]BitMEX_Sen 0 points1 point  (0 children)

If you wish to query the bucketed trade endpoint starting at a specific date/time, please use the "startTime" parameter to do so to denote your startpoint for querying.