2021年3月5日星期五

How to download FINRA -Equity short interest data in python for the certain period of time?

I am trying the below json code for downloading the data, but I can only download for a certain day. I am very new to coding, and not sure where to fix the codes for getting the whole dataset for the certain period of time, e.g 2018.06.01 to 2021.03.05. The original code is in below curl command headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', }

data = '{ "compareFilters": [ { "compareType": "EQUAL", "fieldName": " settlementDate", "fieldValue": " 2018-06-15" } ] ,"limit":5 } '

response = requests.post('https://api.finra.org/data/group/otcMarket/name/EquityShortInterest', headers=headers, data=data)

But I was able to change the below json format to run in python.

headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', }

data = '{ "compareFilters": [ { "compareType": "EQUAL", "fieldName": " settlementDate", "fieldValue": " 2018-06-15" } ] ,"limit":5 } '

response = requests.post('https://api.finra.org/data/group/otcMarket/name/EquityShortInterest', headers=headers, data=data)

https://stackoverflow.com/questions/66501668/how-to-download-finra-equity-short-interest-data-in-python-for-the-certain-peri March 06, 2021 at 10:00AM

没有评论:

发表评论