Strange behavior in COIN-M API

I’m trying to use COIN-M methods (using python-binance) and am running into weir errors. Analogous USD-M with same parameters are working fine.

This works:

client.get_historical_klines(
    symbol="SOLBUSD",
    interval="1m",
    start_str="2022-09-27 11:54:17.480347+00:00",
    end_str="2022-09-27 13:54:17.480347+00:00",
    klines_type=HistoricalKlinesType.FUTURES,
)

This throws error BinanceAPIException: APIError(code=-4088): Maximum time interval is 200 days.

client.get_historical_klines(
    symbol="SOLUSD_PERP",
    interval="1m",
    start_str="2022-09-27 11:54:17.480347+00:00",
    end_str="2022-09-27 12:54:17.480347+00:00",
    klines_type=HistoricalKlinesType.FUTURES_COIN,
)

What’s wrong?

Hey, we’re not responsible for the maintenance of python-binance, please reach out to its developers.

From the outside, it seems the code is not processed correctly and it mistakes the start and end time diff to be above 200 days, which doesn’t respect the rule stated in the COIN-M Documentation (Binance API Documentation):

  • The difference between startTime and endTime can only be up to 200 days

The problem is, dates in usd-m and coin-m requests are exactly the same.

Ok, I will reach out to library maintainers.