PHPackages                             j3j5/twitterapio - 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. j3j5/twitterapio

ActiveLibrary[API Development](/categories/api)

j3j5/twitterapio
================

A wrapper for the great tmhoauth to use with Twitter's API.

1.3.3(4y ago)1338LGPL-3.0-or-laterPHPPHP &gt;=5.3.0

Since Mar 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/j3j5/twitterapio)[ Packagist](https://packagist.org/packages/j3j5/twitterapio)[ RSS](/packages/j3j5-twitterapio/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

TwitterApio
===========

[](#twitterapio)

TwitterApio is a small wrapper to use Twitter's API from you PHP app.

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

[](#installation)

Add `j3j5/twitterapio` to `composer.json`.

```
"j3j5/twitterapio": "dev-master"

```

Run `composer update` to pull down the latest version of Twitter.

Configuration
-------------

[](#configuration)

Open up the `config.php` included with the package and set there all your consumer keys and tokens.

Alternatively, you can set your own config array and use it to overwrite the config file when you create the first instance of TwitterApio. The twitter config must be as follows:

```
$twitter_settings = array(
	'consumer_key'		=> 'YOUR_CONSUMER_KEY',
	'consumer_secret'	=> 'YOUR_CONSUMER_SECRET',
	'token'				=> 'A_USER_TOKEN',
	'secret'			=> 'A_USER_TOKEN_SECRET',
);

$api = new TwitterApio($twitter_settings);
```

Use
---

[](#use)

Once you have created your own instance of the library, you can use any of the public methods to request from Twitter's API.

If you decide to set your tokens from your own app instead of from the config file:

```
$twitter_settings = array(
	'consumer_key'		=> 'YOUR_CONSUMER_KEY',
	'consumer_secret'	=> 'YOUR_CONSUMER_SECRET',
	'token'				=> 'A_USER_TOKEN',
	'secret'			=> 'A_USER_TOKEN_SECRET',
);

$api = new TwitterApio($twitter_settings);

// Now you can do all type of requests
$credentials = $api->get('account/verify_credentials');
$tweet = $api->post('statuses/update', array('status' => 'Testing TwitterApio!!!'));
```

Or the more interesting ones...the ones with iterators!!

```
$username = "masaenfurecida";
$tweets = array();
// getTimeline() can be used with any endpoint that returns a timeline (like statuses/mentions_timeline, statuses/home_timeline)
foreach($api->getTimeline('statuses/user_timeline', array('screen_name' => $username, 'count' => 200)) as $page) {
	if(is_array($page) ) {
		$tweets = array_merge($tweets, $page);
	}
}

$followers = array();
foreach($api->getFollowers(array('screen_name' => $username, 'count' => 5000)) as $page) {
	if(is_array($page) ) {
		$followers = array_merge($followers, $page);
	}
}

$friends = array();
foreach($api->getFriends(array('screen_name' => $username, 'count' => 5000)) as $page) {
	if(is_array($page) ) {
		$friends = array_merge($friends, $page);
	}
}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% 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 ~270 days

Recently: every ~370 days

Total

7

Last Release

1729d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87fcc720208de023144a17f3e72cccf8fb872d652b8f1ab0724c765e44e3d717?d=identicon)[j3j5](/maintainers/j3j5)

---

Top Contributors

[![j3j5](https://avatars.githubusercontent.com/u/1239921?v=4)](https://github.com/j3j5 "j3j5 (51 commits)")[![jfoulquie-tnw](https://avatars.githubusercontent.com/u/159464174?v=4)](https://github.com/jfoulquie-tnw "jfoulquie-tnw (6 commits)")

---

Tags

agplv3libraryphptwitter-apiphpapitwitter

### Embed Badge

![Health badge](/badges/j3j5-twitterapio/health.svg)

```
[![Health](https://phpackages.com/badges/j3j5-twitterapio/health.svg)](https://phpackages.com/packages/j3j5-twitterapio)
```

###  Alternatives

[fennb/phirehose

A PHP interface to the Twitter Streaming API.

698402.4k3](/packages/fennb-phirehose)[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)[redwebcreation/twitter-stream-api

Consume the Twitter Stream API in real-time.

3220.3k1](/packages/redwebcreation-twitter-stream-api)[owlycode/streaming-bird

A PHP client for the Twitter Streaming APIs inspired from Phirehose.

1024.6k](/packages/owlycode-streaming-bird)[anahkiasen/flickering

A modern interface for the Flickr API

535.9k1](/packages/anahkiasen-flickering)

PHPackages © 2026

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