areed1192 / td-ameritrade-python-api

Unofficial Python API client library for TD Ameritrade. This library allows for easy access of the Standard API and allows users to build data pipelines for the Streaming API.
MIT License
683 stars 250 forks source link

get_market_hours not working #62

Closed spitzbubchen closed 4 years ago

spitzbubchen commented 4 years ago

The following:

TDSession.get_market_hours(markets = ['EQUITY'], date = '2019-10-19')

leads to this error:

RESPONSE TEXT: {"timestamp":"2020-07-12","status":400,"error":"Bad Request","message":"Input date is not acceptable.","path":"/markethours-v1/markets/"}

areed1192 commented 4 years ago

It's because it's a historical date, you can only use the current day and after.

spitzbubchen commented 4 years ago

Okay, got it! Wasn't clear from the TD API documentation:

The date for which market hours information is requested. Valid ISO-8601 formats are : yyyy-MM-dd and yyyy-MM-dd'T'HH:mm:ssz.