Hi @pablo.mitchell
I ran your example code and these are the results I get:
For 10 symbols, 1 year daily data
Getting bars:
n_symbols=10
timeframe=1Day
start=2020-09-29
end=2021-09-29
bad response: ('ZWS', Empty DataFrame
Columns: []
Index: [])
Showing results:
n_bars=10
n_errors=0
n_bad_requests=1
took 1 sec
For 100 symbols, 1 year daily data
Getting bars:
n_symbols=100
timeframe=1Day
start=2020-09-29
end=2021-09-29
bad response: ('WOLF', Empty DataFrame
Columns: []
Index: [])
...
bad response: ('ZWS', Empty DataFrame
Columns: []
Index: [])
Showing results:
n_bars=100
n_errors=0
n_bad_requests=4
took 1 sec
Process finished with exit code 0
For 1000 symbols, 1 year daily data
Getting bars:
n_symbols=1000
timeframe=1Day
start=2020-09-29
end=2021-09-29
bad response: ('RRX', Empty DataFrame
Columns: []
Index: [])
...
bad response: ('ZWS', Empty DataFrame
Columns: []
Index: [])
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=14
took 5 sec
Process finished with exit code 0
For all( ) symbols, 1 year daily data
Getting bars:
n_symbols=9516
timeframe=1Day
start=2020-09-29
end=2021-09-29
...
Showing results:
n_bars=9516
n_errors=530
n_bad_requests=127
took 303 sec
Process finished with exit code 0
I do see the errors you refer to, when trying to get data for 9000 stocks
but the errors are roughly for 600 out of 9000 stocks.
an important thing to note is
the time it took for 9000 stocks - 5 minutes!
you could never get those results for the rest module (it will take you hours to achieve that)
What ca you do
Each API has limitations and it doesn’t allow the user to get endless data at once. BUT, we could work with that.
Split your requests to segments of 1000 stocks each time.
When I did that I got this result:
Getting bars:
n_symbols=9516
timeframe=1Day
start=2020-09-29
end=2021-09-29
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=7
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=12
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=16
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=14
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=20
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=19
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=15
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=7
Showing results:
n_bars=1000
n_errors=0
n_bad_requests=10
Showing results:
n_bars=516
n_errors=0
n_bad_requests=11
took 49 sec
Process finished with exit code 0
roughly 130 stocks with bad data out of ~9000. not bad. AND it only took 50 seconds!!
I will add the modified code in the next comment