While attempting to make an authenticated request for GOOG price history, TD Ameritrade's API will return 4210, 1 minute candles with epoch times beginning at 160. I'm expecting 365 candles, 1 per day, with an epoch starting with 157. The exact same parameters work fine on TD's API information page. In my code, no matter what parameters are in payload, TD returns the same information. It won't even throw an error. It's like payload is being ignored completely and a default query is being made. Pricehistory seems to be the only endpoint that is exhibiting this behaviour. I could work around this by calculating epoch time and inserting as start and end points, but the API should give me what I ask for without having to do that extra work.
url = "https://api.tdameritrade.com/v1/marketdata/GOOG/pricehistory" headers = {"Authorization":"Bearer " + access_token} payload = {"periodType":"year", "period":"1", "frequencyType":"daily", "frequency":"1"} authReply = requests.get(url, headers = headers, data = payload)
Submitted November 02, 2020 at 10:23PM by FangPiZhuanJia
via https://ift.tt/3oLFDr3