PHPackages                             mackensiealvarezz/tdameritrade-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mackensiealvarezz/tdameritrade-laravel

ActiveLibrary[API Development](/categories/api)

mackensiealvarezz/tdameritrade-laravel
======================================

TD Ameritrade API Package For Laravel

2.0.1(5y ago)14834[1 issues](https://github.com/mackensiealvarezz/tdameritrade-laravel/issues)[5 PRs](https://github.com/mackensiealvarezz/tdameritrade-laravel/pulls)MITPHP

Since Jul 11Pushed 3y ago4 watchersCompare

[ Source](https://github.com/mackensiealvarezz/tdameritrade-laravel)[ Packagist](https://packagist.org/packages/mackensiealvarezz/tdameritrade-laravel)[ RSS](/packages/mackensiealvarezz-tdameritrade-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (9)Used By (0)

[![Continuous Integration](https://github.com/mackensiealvarezz/tdameritrade-laravel/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/mackensiealvarezz/tdameritrade-laravel/workflows/Continuous%20Integration/badge.svg?branch=master)

TD Ameritrade API for Laravel
=============================

[](#td-ameritrade-api-for-laravel)

This package is a wrapper for the TD Ameritrade API. You will need a [developer account](https://developer.tdameritrade.com/) to use this API.

Installing
==========

[](#installing)

1 . install the package via composer:
-------------------------------------

[](#1--install-the-package-via-composer)

```
composer require mackensiealvarezz/tdameritrade-laravel

```

2. Publish Config
-----------------

[](#2-publish-config)

```
php artisan vendor:publish

```

3. Set ENV Variables
--------------------

[](#3-set-env-variables)

Include these two variables inside of your .env

```
// .env
TD_KEY="YOUR_KEY"
TD_CALLBACK="CALLBACK"

```

4. Include Package
------------------

[](#4-include-package)

When using the package, don't forget to include It on top of the file

```
use Mackensiealvarezz\Tdameritrade\Tdameritrade;

```

OAuth
=====

[](#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
------------------

[](#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
-------------

[](#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
=====

[](#usage)

The package is written to use every class inside of **/src/api** as a function.

Accounts
--------

[](#accounts)

### List accounts

[](#list-accounts)

This will return a list of all the accounts

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
$accounts = $client->accounts()->list();

```

### Get account

[](#get-account)

This will return all the information for one account. **Requires account\_id**

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
$accounts = $client->accounts()->get('account_id');

```

Instruments
-----------

[](#instruments)

### Search

[](#search)

This will return a list of tickers based on the symbol entered

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
//Response
$response = $client->instruments()->search('TESLA');

```

### Get

[](#get)

This wil return one ticker information

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
//Response
$accounts = $client->instruments()->get('TSLA');

```

Market Hours
------------

[](#market-hours)

### List

[](#list)

This will return a list of all the different market hours

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
//Response
$response = $client->market()->list();

```

### Get

[](#get-1)

This wil return one market information

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
//Response
$response = $client->market()->get('SPY.X');

```

Movers
------

[](#movers)

### Get

[](#get-2)

This wil return a list of symbols that are moving

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
//Response
$response = $client->movers()->get('SPY.X', 'up', 'percent');

```

Price
-----

[](#price)

### History

[](#history)

This will return a list of quotes for the ticker

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
//Response
$response = $client->price()->history('TSLA', Carbon::now(), Carbon::now());

```

### Get Quote

[](#get-quote)

This wil return the quote for one ticker

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
//Response
$response = $client->price()->quote('TSLA');

```

### Get Quotes

[](#get-quotes)

This wil return the quote for multiple tickers

```
//Create client
$client =  new Tdameritrade('access_token', 'refresh_token');
//Response
$response = $client->price()->quotes(['AAPL', 'FB']);

```

License
-------

[](#license)

The MIT License (MIT). Please see [MIT license](http://opensource.org/licenses/MIT) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 78.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2131d ago

Major Versions

1.0.0 → 2.0.02020-07-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dae98ecad433a4d5f98a25e625b2747bd9b249bba5de8f4c2dbaf90d4f0246a?d=identicon)[mackensiealvarezz](/maintainers/mackensiealvarezz)

---

Top Contributors

[![mackensiealvarezz](https://avatars.githubusercontent.com/u/6855367?v=4)](https://github.com/mackensiealvarezz "mackensiealvarezz (18 commits)")[![ecomrick77](https://avatars.githubusercontent.com/u/61747132?v=4)](https://github.com/ecomrick77 "ecomrick77 (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mackensiealvarezz-tdameritrade-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/mackensiealvarezz-tdameritrade-laravel/health.svg)](https://phpackages.com/packages/mackensiealvarezz-tdameritrade-laravel)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
