TD Ameritrade API


Category:
0
0

Dose any one know how to and/use TD Ameritrade API into excel?

yes td ameritrade has an API and TD Ameritrade API its easy to use.

Thank You

Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on January 13, 2019 8:23 pm
311 views
0
Private answer

It's an "expert friendly" system.  The first time is pretty hard to do but once you got the first token, the Refresh is easy enough.

Steps

1. Register your application at TDA https://developer.tdameritrade.com/

2. Go to my Apps and create an App

3. Give a name and user id and set the Callback URL to a http :// localhost and a description

4. Get an Authorization code:

https://developer.tdameritrade.com/content/simple-auth-local-apps

to get the code open 4 new tabs and put this http address with your local host and user id into tab 1 adress:

https://auth.tdameritrade.com/auth?response_type=code&redirect_uri=http://localhost&client_id=<your Client ID>%40AMER.OAUTHAP

Note:

you need to have your windows local host turned on for this to work properly

control panel > Programs > Turn Windows features on or Off > Check on:

- Internet information Services

- Internet information Services Hostable Web core

5. Authorize the link to your TD trading Account username and password

6. Go to the link and it will give you a "unable to connect 404 page" error , but ,

copy the http part that comes after “code=” in the http address it is a long series of numbers and letters

copy the address to a note pad

7. Google URL decode and decode in tab 2 of the browser

or go to this decoder https://meyerweb.com/eric/tools/dencoder/

copy the code in the URL and decode the code and keep this new code

8. Get the Access Token here on tab 3

https://developer.tdameritrade.com/authentication/apis/post/token-0

Fill the Access Token information

grant_type: authorization_code

access_type: offline

code = the URL CODE you copied and decoded goes here

client_id =<your Client ID>

redirect_uri = http://localhost

Press send and get the token code will be in the response tab at the bottom

"access_token": " Your token code is here "

Copy all info on a note pad

NOTE:

Refresh Code Last for 90 days

Access Code Last for 30 minutes

9. Go to the TD developer quotes API and paste the Token Code in Authorization on tab 4

https://developer.tdameritrade.com/quotes/apis/get/marketdata/quotes

Symbol = AAPL

Authorization = the token code you requested from Post Access Token

Authenticate in the little box bottom left corner with your TD trading account username and password

you are now able to get real time data request from TD API

The Token will Expire in 30 minutes but you may have to use your refresh token

This will allow you to get real time data of a list of stocks manually and it will allow you to gain access to all the other APIs

https://developer.tdameritrade.com/apis

To get this processes to work in your coding software program your program must be able to make

http Get / Put request and read JSON file responses

because TD Ameritrade has no respect for beginners they assumes people know what they do and it is very cumbersome

i am currently trying to learn implementation in the code

https://developer.tdameritrade.com/guides

Hope this helps.  It is a work in progress......

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on July 5, 2020 7:19 pm