Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tdameritrade-api-ruby

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tdameritrade-api-ruby

  • 1.3.0.20210215
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

TD Ameritrade API gem for Ruby

This is a gem for connecting to the OAuth/JSON-based TD Ameritrade Developers API released in 2018. Go to https://developer.tdameritrade.com/ for the official documentation and to create your OAuth application.

For a gem that allows you to connect to the older version of the TDAmeritrade API, go to https://github.com/wakproductions/tdameritrade_api

Installation

In your Gemfile

gem 'tdameritrade-api-ruby', git: 'https://github.com/wakproductions/tdameritrade-api-ruby.git'

Authenticating

Currently this gem is designed for private app authorization. Read this guide for a general overview of signing in your private app: https://developer.tdameritrade.com/content/simple-auth-local-apps

The TD Ameritrade API now uses OAuth for authentication. For an introduction to the OAuth flow, I recommend reading this tutorial.

I plan on writing more detailed instructions in the file /doc/authentication.md

Basic Usage

client = TDAmeritrade::Client.new(
  client_id: 'MYCLIENTID@AMER.OAUTHAP', 
  redirect_uri: 'http://my-redirect-url', 
  refresh_token: 'b6w31RJvP/Cz3MVghpx8S5dzeYVcHygEQHKWYQuI98NGpsMb1j...'
)

client.get_instrument_fundamentals('TWTR')
#=> {"TWTR"=>
      {"fundamental"=>
        {"symbol"=>"TWTR",
         "high52"=>47.79,
         "low52"=>20.12,
         "dividendAmount"=>0.0,
         "dividendYield"=>0.0,
         "peRatio"=>17.93788,
         "pegRatio"=>0.039026,
         "pbRatio"=>3.85707,
         ...

Current State of Functionality

The official API is documented here. This gem currently implements the following functionality. If you would like to expand its functionality, then please submit a pull request.

  • Accounts and Trading
  • Authentication
  • Instruments
  • Market Hours
  • Movers
  • Option Chains
  • Price History
  • Real-time Quotes
  • Transaction History
  • User Info and Preferences
  • Watchlist
    • Get Watchlists
    • Replace Watchlist
    • Delete Watchlist
    • Update Watchlist

Contributions

If you would like to make a contribution, please submit a pull request to the original branch. Feel free to email me Winston Kotzan at wak@wakproductions.com with any feature requests, bug reports, or feedback.

Wish List
  • Test Coverage in RSpec

Support

Please open an issue on Github if you have any problems or questions.

Release Notes

See CHANGELOG.md

FAQs

Package last updated on 16 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc