'Problem with getting testnet data from binance
I am trying to get trade data from the Binance API using the testnet server. The code I have written runs, however, I am trying to collect data for daily intervals and am using a period of 5 days from 1 May 2022 - 5 May 2022. This should give me five sets of data but I only get data for two days. Why does this happen? I have attached my code:
from binance.client import Client
import pandas as pd
import os
import time
from datetime import datetime
import plotly.graph_objects as go
import pprint
api_test_key = os.getenv("API_TEST_KEY")
api_test_secret = os.getenv("API_TEST_SECRET")
client = Client(api_test_key, api_test_secret, testnet=True)
start = "1 May 2022"
end = "5 May 2022"
klines = client.get_historical_klines(symbol='ETHUSDT', interval=client.KLINE_INTERVAL_1DAY,
start_str=start, end_str=end)
pprint.pprint(klines)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
