Get Price History

GET

Get Price History

Get price history for a symbol

Resource URL

https://api.tdameritrade.com/v1 /marketdata/{symbol}/pricehistory

Query Parameters

Name Values Description
apikey

Pass your OAuth User ID to make an unauthenticated request for delayed data.

periodType

The type of period to show. Valid values are day, month, year, or ytd (year to date). Default is day.

period

The number of periods to show.

Example: For a 2 day / 1 min chart, the values would be:

period: 2
periodType: day
frequency: 1
frequencyType: min

Valid periods by periodType (defaults marked with an asterisk):

day: 1, 2, 3, 4, 5, 10*
month: 1*, 2, 3, 6
year: 1*, 2, 3, 5, 10, 15, 20
ytd: 1*

frequencyType

The type of frequency with which a new candle is formed.

Valid frequencyTypes by periodType (defaults marked with an asterisk):

day: minute*
month: daily, weekly*
year: daily, weekly, monthly*
ytd: daily, weekly*

frequency

The number of the frequencyType to be included in each candle.

Valid frequencies by frequencyType (defaults marked with an asterisk):

minute: 1*, 5, 10, 15, 30
daily: 1*
weekly: 1*
monthly: 1*

endDate

End date as milliseconds since epoch. If startDate and endDate are provided, period should not be provided. Default is previous trading day.

startDate

Start date as milliseconds since epoch. If startDate and endDate are provided, period should not be provided.

needExtendedHoursData

true to return extended hours data, false for regular market hours only. Default is true

Header Parameters

Name Values Description
Authorization

Supply an access token to make an authenticated request. The format is Bearer <access token>.

Try it out !!

symbol Enter one symbol (case-sensitive). true

HTTP Basic

OAuth 2.0

API Key

RESET

Make a request and see the response.

Make a request and see the response.

Make a request and see the response.

Resource Summary

Security

Content Type

application/json

Category

Price History

Response Summary

Resource Error Codes

HTTP Code

Description

401

Unauthorized

403

Forbidden

404

Not Found

Working...