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

ActiveLibrary[API Development](/categories/api)

cjrasmussen/twitter-api
=======================

Simple helper for interacting with Twitter's API

1.2.5(7mo ago)0149MITPHPPHP &gt;=7.4.0

Since Sep 14Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/cjrasmussen/TwitterApi)[ Packagist](https://packagist.org/packages/cjrasmussen/twitter-api)[ Docs](https://cjr.dev)[ RSS](/packages/cjrasmussen-twitter-api/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (2)DependenciesVersions (16)Used By (0)

TwitterApi
==========

[](#twitterapi)

Simple class for making requests to the Twitter API. Not affiliated with Twitter.

Usage
-----

[](#usage)

```
use cjrasmussen\TwitterApi\TwitterApi;

$twitter = new TwitterApi($consumer_key, $consumer_secret);

// SEND A TWEET WITH OAUTH TOKEN/SECRET
$twitter->auth(TwitterApi::AUTH_TYPE_OAUTH, $token, $secret);
$response = $twitter->request('POST', '1.1/statuses/update.json', ['status' => 'Tweet text']);

// SEND A TWEET WITH BEARER TOKEN
$twitter->auth(TwitterApi::AUTH_TYPE_BEARER, $token);
$response = $twitter->request('POST', '1.1/statuses/update.json', ['status' => 'Tweet text']);
```

More Examples
-------------

[](#more-examples)

More examples, as well as other things I've learned using the Twitter API, are [available at my blog](https://cjr.dev/tag/trello-automation/).

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

[](#installation)

Simply add a dependency on cjrasmussen/twitter-api to your composer.json file if you use [Composer](https://getcomposer.org/) to manage the dependencies of your project:

```
composer require cjrasmussen/twitter-api
```

Although it's recommended to use Composer, you can actually include the file(s) any way you want.

License
-------

[](#license)

TwitterApi is [MIT](http://opensource.org/licenses/MIT) licensed.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance65

Regular maintenance activity

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~132 days

Recently: every ~199 days

Total

15

Last Release

214d ago

PHP version history (2 changes)v1.0PHP &gt;=7.1.0

1.2.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0225f44837a665c8a143afa50a34a406a769c523dba31e4cdf73fd0530dede45?d=identicon)[cjrasmussen](/maintainers/cjrasmussen)

---

Top Contributors

[![cjrasmussen](https://avatars.githubusercontent.com/u/15007730?v=4)](https://github.com/cjrasmussen "cjrasmussen (16 commits)")

---

Tags

twitter

### Embed Badge

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

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

###  Alternatives

[jublonet/codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.

770865.9k10](/packages/jublonet-codebird-php)[atymic/twitter

Twitter API for PHP &amp; Laravel

945555.4k2](/packages/atymic-twitter)[noweh/twitter-api-v2-php

This library provides methods for sending messages to Twitter and receiving statuses.

131225.2k1](/packages/noweh-twitter-api-v2-php)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[philo/laravel-twitter

A simple Laravel 4 service provider for including the TwitterOAuth library.

5019.5k](/packages/philo-laravel-twitter)[makotokw/twient

Twitter Client for PHP 5.3+

2632.0k](/packages/makotokw-twient)

PHPackages © 2026

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