how to download depth data from TRTH/datascope using Python REST API?
1
I am trying to download depth data from Tick History Market Depth/Legacy market depth using REST API from this post. As you already know, depth data is quite large. so I would like to save the files by date. i.e. instead of having 1 giant file, I have one file for each day that contains depth data for all stocks in the list. I would also love to separate by stock and then by date as well but by date is fine for now. How would I go about it? The following is my code. I use Python 3.6 with Pycharm by the way. And I am not really good with Python. I normally use SAS. While the code is long, there are 4 big parts: 1. A JSON file that specifies the fields to download 2. a RequestNewToken function to get token each time 3. A function that extracts data 4. A main function that runs the above 2 functio...