PHPackages                             plugrbase/laravel-twitter-api - 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. plugrbase/laravel-twitter-api

ActiveLibrary[API Development](/categories/api)

plugrbase/laravel-twitter-api
=============================

Twitter API wrapper for Laravel 8.x|9.x

v0.9.9(3y ago)1652MITPHPPHP ^7.4|^8.0

Since Feb 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/plugrbase/laravel-twitter-api)[ Packagist](https://packagist.org/packages/plugrbase/laravel-twitter-api)[ Docs](https://github.com/plugrbase/laravel-twitter-api)[ RSS](/packages/plugrbase-laravel-twitter-api/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (5)Versions (9)Used By (0)

A small Laravel wrapper for the Twitter API V2.
===============================================

[](#a-small-laravel-wrapper-for-the-twitter-api-v2)

A very small package providing some functions to access the Twitter V2 API.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require plugrbase/laravel-twitter-api
```

Optionally publish the config file of this package:

```
php artisan vendor:publish --provider="Plugrbase\TwitterApi\TwitterApiServiceProvider"
```

Add the following environment variables.

```
TWITTER_API_CONSUMER_KEY=
TWITTER_API_CONSUMER_KEY_SECRET=
TWITTER_BEARER_TOKEN=
TWITTER_ACCESS_TOKEN=
TWITTER_TOKEN_SECRET=
TWITTER_API_URL=

```

Functions
---------

[](#functions)

### Twitter API v2

[](#twitter-api-v2)

- `$twitterApi = new TwitterApi($bearerToken, $oAuthCredentials);` - Create a new instance. If the oauth credentials are not passed, then the application config variables we'll be used instead (if provided).

#### Tweet

[](#tweet)

- `$twitterApi->tweet()->get($tweetId)` - Return a single Tweet.
- `$twitterApi->tweet()->get($tweetId, ['expansions' => 'referenced_tweets.id.author_id','place.fields' => 'contained_within,country']);` - Return a single Tweet with optional query parameters.
- `$twitterApi->tweet()->getMany([$tweetId1, $tweetId2])` - Return multiple Tweets.
- `$twitterApi->tweet()->create($params)` - Create a Tweet. ex $params = \["text": "Hello World!"\];

#### User

[](#user)

- `$twitterApi->user()->get($userId)` - Return a single user.
- `$twitterApi->user()->get($userId, , ['user.fields' => 'created_at']);` - Return a single user with optional query parameters.
- `$twitterApi->user()->getMany([$userId1, $userId2])` - Return multiple users.
- `$twitterApi->user()->getByUsername($username)` - Return a single user by username.
- `$twitterApi->user()->getManyByUsername([$username1, $username2])` - Return multiple users by username.
- `$twitterApi->user()->getFollowers($userId)` - Return all the followers of a user.
- `$twitterApi->user()->getFollowers($userId, ['max_results' => 5])` - Return the five earliest followers of a user.
- `$twitterApi->user()->getTweets($userId)` - Return all the tweets of a user. By default, the most recent ten Tweets are returned per request. Using pagination, the most recent 3,200 Tweets can be retrieved.
- `$twitterApi->user()->getTweets($userId, ['max_results' => 5])` - Return the five earliest tweets of a user.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~16 days

Recently: every ~6 days

Total

8

Last Release

1424d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c4547b5482d26ce478f454ec301e8cc0104f97aa7b05086b58037429816cc75?d=identicon)[Djoul](/maintainers/Djoul)

---

Top Contributors

[![Djoul](https://avatars.githubusercontent.com/u/99880?v=4)](https://github.com/Djoul "Djoul (14 commits)")

---

Tags

plugrbaselaravel-twitter-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/plugrbase-laravel-twitter-api/health.svg)

```
[![Health](https://phpackages.com/badges/plugrbase-laravel-twitter-api/health.svg)](https://phpackages.com/packages/plugrbase-laravel-twitter-api)
```

###  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)
