td-ameritrade-python-api | Unofficial Python API client library for TD Ameritrade | REST library
kandi X-RAY | td-ameritrade-python-api Summary
kandi X-RAY | td-ameritrade-python-api Summary
The unofficial Python API client library for TD Ameritrade allows individuals with TD Ameritrade accounts to manage trades, pull historical and real-time data, manage their accounts, create and modify orders all using the Python programming language. To learn more about the TD Ameritrade API, please refer to the official documentation.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get a list of transactions
- Make a request
- Create headers dict
- Construct the API endpoint
- Gets the latest orders query
- Get the order path for an account
- Search the API
- Validate the argument for the given endpoint
- Create a new chart
- Validate argument
- Create a new request template
- Get price history
- Read data from a stream
- Chart the history of a symbol
- Create a streaming session
- Get a list of principals
- Get all movers
- Set write behavior
- List accounts
- Gets market hours
- Replaces a watchlist
- Update the preferences for an account
- A method to retrieve a list of principals
- Returns a list of active actives
- Modify an order
- Update a watchlist
- Request quality of service
td-ameritrade-python-api Key Features
td-ameritrade-python-api Examples and Code Snippets
Community Discussions
Trending Discussions on td-ameritrade-python-api
QUESTION
Using documentation from https://pypi.org/project/td-ameritrade-python-api/
I'm trying to get started with the TD Ameritrade API in Python...
The problem I am having is with authentication of my account which is done via this Url: (note: client_id has been changed b/c it is private)
So everything works:
- I get the login screen
- After successful login, I get the permissions page
EXCEPT...
When everything is completed I get this error from FireFox (or Chrome, whatever)
Unable to connect
Firefox can’t establish a connection to the server at 127.0.0.1.
Given the above issue, I search Google for info and did the following:
- Cleared Cache
- Made sure correct IIS settings were configured
It does not work at this point.
I have no idea what is going on. Any help would be greatly appreciated.
...ANSWER
Answered 2020-Dec-14 at 06:08This is probably one of the few times when getting an error message like you did is actually part of the process to authenticate your account. At the very bottom of the PyPi page for that library he explains that you're supposed to copy and paste the resulting url of the error page you're currently on into your terminal. It was confusing for me aswell and it took me awhile to really understand what's going on so I will explain it as best as I can.
Alex Reed is the guy who made the library TD Ameritrade API and he has an awesome YouTube channel called Sigma Coding. One of his video series guides you through the whole process of directly connecting to the TD Ameritrade API without the use of his API library, and another series about building the library itself.
In this video How to Use the TD Ameritrade API | Part 2 he is demonstrating how to access the API. The link should have a time stamp of 16:36 if not skip ahead to that section and you will see a similar error to what you are experiencing except he is using Chrome, not Firefox so the error is the same but worded differently.
Here's a picture to better explain the rest:
What he does next is copy and paste the current url of the page with the error, which contains the code needed for the next step. The url in the picture starts with https://localhost/test?code=siVrfqPLdQ...
and you can see that the url has code=
following a very long access code that TD Ameritrade needs to generate your access token.
Your url should have a similar structure, don't worry if it doesn't have /test
after localhost, he made a specific folder for the video series. Just copy and paste the whole thing in your terminal where you should have a line that says:
Paste the full redirect url here:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install td-ameritrade-python-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page