Download the PHP package mackensiealvarezz/tdameritrade-laravel without Composer
On this page you can find all versions of the php package mackensiealvarezz/tdameritrade-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mackensiealvarezz/tdameritrade-laravel
More information about mackensiealvarezz/tdameritrade-laravel
Files in mackensiealvarezz/tdameritrade-laravel
Package tdameritrade-laravel
Short Description TD Ameritrade API Package For Laravel
License MIT
Informations about the package tdameritrade-laravel
TD Ameritrade API for Laravel
This package is a wrapper for the TD Ameritrade API. You will need a developer account to use this API.
Installing
1 . install the package via composer:
2. Publish Config
3. Set ENV Variables
Include these two variables inside of your .env
4. Include Package
When using the package, don't forget to include It on top of the file
use Mackensiealvarezz\Tdameritrade\Tdameritrade;
OAuth
To use the API, the must have an access_token. You can easily create an access token using the redirect function.
Creating OAuth URL
To create a OAuth URL, you will need to use:
Tdameritrade::redirectOAuth(); // will return string (url)
It is important that you create a callback route for the URL you set inside of the .env
Refresh Token
To refresh the token and create another access_token.
//Create client
$client = new Tdameritrade('access_token', 'refresh_token');
//Refresh token
$response = $client->refreshToken();
Usage
The package is written to use every class inside of /src/api as a function.
Accounts
List accounts
This will return a list of all the accounts
Get account
This will return all the information for one account. Requires account_id
Instruments
Search
This will return a list of tickers based on the symbol entered
Get
This wil return one ticker information
Market Hours
List
This will return a list of all the different market hours
Get
This wil return one market information
Movers
Get
This wil return a list of symbols that are moving
Price
History
This will return a list of quotes for the ticker
Get Quote
This wil return the quote for one ticker
Get Quotes
This wil return the quote for multiple tickers
License
The MIT License (MIT). Please see MIT license for more information.