Giter Site home page Giter Site logo

ex_tda's Introduction

ExTda

ExTda helps Elixir users use the TDAmeritrade API.

To use this, set the TDA_CLIENT_ID environment variable to your developer Client ID. .envrc.example is an example file that, once renamed to just .envrc, can be used with direnv.

To get your developer Client ID sign in at https://developer.tdameritrade.com with your TDAmeritrade brokerage account and go to the My Apps tab. Create an app with the callback url of https://127.0.0.1:4000. The Client ID here is what you need.

To use ExTda, make sure .envrc is updated with your Client ID, and generate self-signed certificates for a local https server in the root directory:

openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out localhost.crt -keyout localhost.key

Finally, use iex -S mix to start up an elixir repl, which also starts a local https server on port 4000. Visit https://12.0.0.1:4000 and TDAmeritrade should ask you to log in. Log in with your brokerage account, allow the permissions warning, and you will be redirected back to https://12.0.0.1:4000?code=... which should do the rest for you. At this point the rest of the functions in module ExTda.Client should work. You can run ExTda.Client.get_access_token/0 which, if you get a token, means things are working. In order to get a token from that the refresh_token must be valid.

ex_tda's People

Contributors

maccam912 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.