PHPackages                             utxo-one/twitter-ultimate-php - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. utxo-one/twitter-ultimate-php

ActiveLibrary[Testing &amp; Quality](/categories/testing)

utxo-one/twitter-ultimate-php
=============================

The Ultimate PHP Wrapper for the Twitter v2 API

v0.1.9(3y ago)215.0k↓73.6%5[2 issues](https://github.com/utxo-one/twitter-ultimate-php/issues)MITPHP

Since Sep 4Pushed 3y ago2 watchersCompare

[ Source](https://github.com/utxo-one/twitter-ultimate-php)[ Packagist](https://packagist.org/packages/utxo-one/twitter-ultimate-php)[ RSS](/packages/utxo-one-twitter-ultimate-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (14)Used By (0)

Twitter Ultimate PHP
--------------------

[](#twitter-ultimate-php)

A complete and opinionated API Wrapper implementation for the Twitter v2 API. Full docblocks for all methods and strict return types make it easy for developers by providing all the method names and parameters to your IDE.

### Prerequisites

[](#prerequisites)

- =&gt; PHP 8.1
- Composer
- Twitter Developer Account

### Installation

[](#installation)

```
composer require utxo-one/twitter-ultimate-php
```

Usage
-----

[](#usage)

### Tweet Client

[](#tweet-client)

The tweet client can be initialized either to get public information, or to perform authenticated actions.

#### Public API Calls

[](#public-api-calls)

You only need to provide your `bearerToken` to initialize a tweet client that accesses public information.

```
use UtxoOne\TwitterUltimatePhp\Clients\TweetClient;

$client = new TweetClient(bearerToken: $_ENV['TWITTER_BEARER_TOKEN']);

$tweet = $client->getTweet('1272846378268347');
```

#### Authenticated API Calls

[](#authenticated-api-calls)

To make an authenticated API call, you need to provide your `apiToken` , `apiSecret`, `accessToken`, `accessSecret`. Access tokens are generated after the user authenticates your app.

```
use UtxoOne\TwitterUltimatePhp\Clients\TweetClient;

$client = new TweetClient(
    apiKey: $_ENV['TWITTER_API_KEY'],
    apiSecret: $_ENV['TWITTER_API_SECRET'],
    accessToken: $_ENV['TWITTER_ACCESS_TOKEN'],
    accessSecret: $_ENV['TWITTER_ACCESS_SECRET'],
);

$tweet = $client->tweet('Hello World!');
```

#### Available Tweet Client Methods:

[](#available-tweet-client-methods)

- `getTweet()`
- `getTweets()`
- `getQuoteTweets()`
- `getLikingUsers()`
- `getRetweetedByUsers()`
- `tweet()`
- `deleteTweet()`
- `likeTweet()`
- `unlikeTweet()`
- `retweet()`
- `unrtweet()`
- `bookmarkTweet()`
- `unbookmarkTweet()`

#### Get Tweet Details

[](#get-tweet-details)

```
use UtxoOne\TwitterUltimatePhp\Clients\TweetClient;

$client = new TweetClient(bearerToken: $_ENV['TWITTER_BEARER_TOKEN']);
$tweet = $client->getTweet('1565628118001455105');

// Available Getter Methods.
$tweet->getId();
$tweet->getText();
$tweet->getCreatedAt();
$tweet->getAuthorId();
$tweet->getConversationId();
$tweet->getInReplyToUserId();
$tweet->getLang();
$tweet->getSource();
$tweet->isWithheld();
$tweet->getPublicMetricS();
$tweet->getReplySettings();
$tweet->getReferencedTweets();
$tweet->getEntities();
$tweet->getGeo();
$tweet->getContextAnnotations();
$tweet->isPossiblySensitive();
$tweet->getAttachements();
```

#### Get Multiple Tweet Details

[](#get-multiple-tweet-details)

```
use UtxoOne\TwitterUltimatePhp\Clients\TweetClient;

$client = new TweetClient(bearerToken: $_ENV['TWITTER_BEARER_TOKEN']);
$tweets = $client->getTweets(['1565628118001455105', '1565999511536914433'])->all();

foreach($tweets as $tweet) {
  $tweet->getId();
  // ...
}
```

### User Management Methods

[](#user-management-methods)

##### Getting a User's Details

[](#getting-a-users-details)

```
use UtxoOne\TwitterUltimatePhp\Clients\UserClient;

$client = new UserClient(bearerToken: $_ENV['TWITTER_BEARER_TOKEN']);

$user = $client->getUserByUsername('utxoone');
$user->getId();
$user->getName();
$user->getUsername();
$user->getCreatedAt();
$user->getDescription();
$user->getLocation();
$user->getPinnedTweetId();
$user->getProfileImageUrl();
$user->getUrl();
$user->isVerified();
$user->isProtected();
$user->getEntities();
```

##### Getting a User's Liked Tweets

[](#getting-a-users-liked-tweets)

```
use UtxoOne\TwitterUltimatePhp\Clients\UserClient;

$client = new UserClient(bearerToken: $_ENV['TWITTER_BEARER_TOKEN']);

$user = $client->getUserByUsername('utxoone');
$likedTweets = $client->getLikedTweets($user->getId())->all();

foreach ($likedTweets as $likedTweet) {
  $likedTweet->getId();
  $likedTweet->getText();
  // ...
}
```

#### Follow a User

[](#follow-a-user)

```
use UtxoOne\TwitterUltimatePhp\Clients\UserClient;

$client = new UserClient(
    apiKey: $_ENV['TWITTER_API_KEY'],
    apiSecret: $_ENV['TWITTER_API_SECRET'],
    accessToken: $_ENV['TWITTER_ACCESS_TOKEN'],
    accessSecret: $_ENV['TWITTER_ACCESS_SECRET'],
);

$user = $client->getUserByUsername('utxo_one');
$tweet = $client->follow($user->getId());
```

##### Available Methods

[](#available-methods)

- `getUserByUsername()`
- `getUserById()`
- `getLikedTweets()`
- `getFollowers()`
- `getFollowing()`
- `follow()`
- `unfollow()`
- `getBlocks()`
- `block()`
- `unblock()`
- `mute()`
- `unmute()`

### List Management Methods

[](#list-management-methods)

##### Getting a List's Details

[](#getting-a-lists-details)

```
use UtxoOne\TwitterUltimatePhp\Clients\ListClient;

$client = new ListClient(bearerToken: $_ENV['TWITTER_BEARER_TOKEN']);

$list = $client->getList('64651656516516516');
$list->getId();
$list->getFollowerCount();
$list->getCreatedAt();
$list->getMemberCount();
$list->isPrivate();
$list->getDescription();
$list->getOwnerId();
```

#### Create a List

[](#create-a-list)

```
use UtxoOne\TwitterUltimatePhp\Clients\ListClient;

$client = new ListClient(
    apiKey: $_ENV['TWITTER_API_KEY'],
    apiSecret: $_ENV['TWITTER_API_SECRET'],
    accessToken: $_ENV['TWITTER_ACCESS_TOKEN'],
    accessSecret: $_ENV['TWITTER_ACCESS_SECRET'],
);

$list = $client->createList(
  name: 'My New List',
  description: 'My New List Description',
  private: false,
);

$list->getId();
```

#### Available Methods

[](#available-methods-1)

- `getList()`
- `getUserOwnedLists()`
- `getListTweets()`
- `getListMembers()`
- `getUserMemberships()`
- `getListFollowers()`
- `getUserFollowedLists()`
- `getUserPinnedLists()`
- `createList()`
- `updateList()`
- `deleteList()`
- `addListMember()`
- `removeListMember()`
- `followList()`
- `unfollowList()`
- `pinList()`
- `unpinList()`

### Space Management Methods

[](#space-management-methods)

##### Getting a Space's Details

[](#getting-a-spaces-details)

```
use UtxoOne\TwitterUltimatePhp\Clients\SpaceClient;

$client = new SpaceClient(bearerToken: $_ENV['TWITTER_BEARER_TOKEN']);

$space = $client->getSpace('64651656516516516');
$space->getId();
$space->getTitle();
$space->getCreatedAt();
$space->getUpdatedAt();
$space->getHostIds();
$space->getState();
$space->isTicketed();
$space->getLand();
$space->getCreatorId();
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.4% 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 ~5 days

Recently: every ~14 days

Total

13

Last Release

1334d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a4c942987b5afb2d4a2bc668c05c3984c264994be5a41e5824c996e030f8e17b?d=identicon)[utxo-one](/maintainers/utxo-one)

---

Top Contributors

[![utxo-one](https://avatars.githubusercontent.com/u/111649294?v=4)](https://github.com/utxo-one "utxo-one (60 commits)")[![PhilETaylor](https://avatars.githubusercontent.com/u/400092?v=4)](https://github.com/PhilETaylor "PhilETaylor (1 commits)")

---

Tags

composercomposer-libraryphpphp81phpunittwittertwitter-apitwitter-api-v2

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/utxo-one-twitter-ultimate-php/health.svg)

```
[![Health](https://phpackages.com/badges/utxo-one-twitter-ultimate-php/health.svg)](https://phpackages.com/packages/utxo-one-twitter-ultimate-php)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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