PHPackages                             ricardoper/twitteroauth - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ricardoper/twitteroauth

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

ricardoper/twitteroauth
=======================

PHP library to communicate with Twitter OAuth API version 1.1

v2.1.6(9y ago)90257.0k↑100%28[1 issues](https://github.com/ricardoper/TwitterOAuth/issues)2MITPHPPHP &gt;=5.3

Since Sep 1Pushed 9y ago14 watchersCompare

[ Source](https://github.com/ricardoper/TwitterOAuth)[ Packagist](https://packagist.org/packages/ricardoper/twitteroauth)[ Docs](https://github.com/ricardoper)[ RSS](/packages/ricardoper-twitteroauth/feed)WikiDiscussions v2 Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (17)Used By (2)

TwitterOAuth
------------

[](#twitteroauth)

PHP library to communicate with Twitter OAuth API version 1.1.

[![Latest Stable Version](https://camo.githubusercontent.com/9663985d611d8bb4c5ef1dd6932cb2c41b2a5e7fbfb752e1597a269ba9b058e9/68747470733a2f2f706f7365722e707567782e6f72672f7269636172646f7065722f747769747465726f617574682f762f737461626c652e737667)](https://packagist.org/packages/ricardoper/twitteroauth) [![Total Downloads](https://camo.githubusercontent.com/9235d9791f4faed93e4e97b1eb174eb985ccffda033220fb3fac644746b86606/68747470733a2f2f706f7365722e707567782e6f72672f7269636172646f7065722f747769747465726f617574682f646f776e6c6f6164732e737667)](https://packagist.org/packages/ricardoper/twitteroauth) [![License](https://camo.githubusercontent.com/768595da7fb0d60a0d0f45324130404a704147a2728731a490e72a376cb281db/68747470733a2f2f706f7365722e707567782e6f72672f7269636172646f7065722f747769747465726f617574682f6c6963656e73652e737667)](https://camo.githubusercontent.com/768595da7fb0d60a0d0f45324130404a704147a2728731a490e72a376cb281db/68747470733a2f2f706f7365722e707567782e6f72672f7269636172646f7065722f747769747465726f617574682f6c6963656e73652e737667)

- Namespaced
- PHP 5.3
- [PSR-2](http://www.php-fig.org/psr/psr-2/ "PHP Framework Interop Group")
- [PSR-4](http://www.php-fig.org/psr/psr-4/ "PHP Framework Interop Group")
- OOP

OAuth Methods Supported
-----------------------

[](#oauth-methods-supported)

- [Single-User OAuth](https://dev.twitter.com/oauth/overview/single-user "Single-user OAuth with Examples")
- [Application-Only Authentication](https://dev.twitter.com/oauth/application-only "Application-only authentication Overview")

**NOTE:** Call media/upload supported, call account/update\_profile\_background\_image not supported.

Requirements
------------

[](#requirements)

- PHP Version &gt;= 5.3
- PHP cURL extension
- PHP JSON extension
- PHP OpenSSL extension
- Lib cURL

**NOTE:** No external dependencies (Guzzle, Symfony Components. etc...)

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

[](#installation)

The recommended way to install TwitterOAuth is through [Composer](http://getcomposer.org/):

```
{
    "require": {
        "ricardoper/twitteroauth": "2.*"
    }
}
```

**NOTE:** If you prefer v1 (One Single File), you can get it in [v1 branch](https://github.com/ricardoper/TwitterOAuth/tree/v1).

cURL Options
------------

[](#curl-options)

After some complaints, I decided to give access to the default options of cURL. This changes solved every connections issues caused by cURL library.

Please check the examples:

- "SingleUser\_With\_cURL\_Options.php"
- "ApplicationOnly\_With\_cURL\_Options.php"

Examples
--------

[](#examples)

Please, see the examples source code from "Examples" folder.

Benchmarks
----------

[](#benchmarks)

Very simple benchmarks from "Examples" source code.

#### Memory Usage

[](#memory-usage)

**Less than 524Kb** except for image uploading. In this case memory depends on the image size.

#### Stress Bench

[](#stress-bench)

**Stress bench done without connection request time.** Single run bench done with and without connection request time. Connection request time may vary depending on the internet connection.

**Machine:**
Intel Core 2 Quad Q6600 2.40GHz
4Gb RAM
7200 rpm HDD

**Versions:**
nginx 1.6.2
PHP v5.5.9
Zend OPcache enabled
SIEGE 3.0.5

**Bench Details:**
20 concurrent connections
1000 requests per thread
No delays between requests
Command: siege -c20 -b -r1000 "URL"

Test NameExecution TimeRequests per Secondv1 ApplicationOnly11.441748.25v1 SingleUser10.051990.05v2 ApplicationOnly16.621203.37v2 SingleUser15.611281.23v2 ApplicationOnly (Without Composer)15.781267.43v2 SingleUser (Without Composer)15.601282.05
Test Name (Single Run)Without Req. TimeWith Req. Timev1 ApplicationOnly0.0038172.056922v1 SingleUser0.0036741.115811v2 ApplicationOnly0.0052011.553395v2 SingleUser0.0052020.847195v2 ApplicationOnly (Without Composer)0.0045131.547005v2 SingleUser (Without Composer)0.0044030.838964
**v1 App Only**
Transactions: 20000 hits
Availability: 100.00 %
Elapsed time: 11.44 secs
Data transferred: 0.46 MB
Response time:0.01 secs
Transaction rate: 1748.25 trans/sec
Throughput:0.04 MB/sec
Concurrency: 19.91
Successful transactions: 20000
Failed transactions: 0
Longest transaction: 0.03
Shortest transaction: 0.00

**v1 Single User**
Transactions: 20000 hits
Availability: 100.00 %
Elapsed time: 10.05 secs
Data transferred: 0.46 MB
Response time:0.01 secs
Transaction rate: 1990.05 trans/sec
Throughput:0.05 MB/sec
Concurrency: 19.86
Successful transactions: 20000
Failed transactions: 0
Longest transaction: 0.05
Shortest transaction: 0.00

**v2 App only**
Transactions: 20000 hits
Availability: 100.00 %
Elapsed time: 16.62 secs
Data transferred: 0.46 MB
Response time:0.02 secs
Transaction rate: 1203.37 trans/sec
Throughput:0.03 MB/sec
Concurrency: 19.91
Successful transactions: 20000
Failed transactions: 0
Longest transaction: 0.06
Shortest transaction: 0.00

**v2 Single User**
Transactions: 20000 hits
Availability: 100.00 %
Elapsed time: 15.61 secs
Data transferred: 0.46 MB
Response time:0.02 secs
Transaction rate: 1281.23 trans/sec
Throughput:0.03 MB/sec
Concurrency: 19.91
Successful transactions: 20000
Failed transactions: 0
Longest transaction: 0.04
Shortest transaction: 0.01

**v2 App Only (Without Composer)**
Transactions: 20000 hits
Availability: 100.00 %
Elapsed time: 15.78 secs
Data transferred: 0.46 MB
Response time:0.02 secs
Transaction rate: 1267.43 trans/sec
Throughput:0.03 MB/sec
Concurrency: 19.91
Successful transactions: 20000
Failed transactions: 0
Longest transaction: 0.04
Shortest transaction: 0.00

**v2 Single User (Without Composer)**
Transactions: 20000 hits
Availability: 100.00 %
Elapsed time: 15.60 secs
Data transferred: 0.46 MB
Response time:0.02 secs
Transaction rate: 1282.05 trans/sec
Throughput:0.03 MB/sec
Concurrency: 19.90
Successful transactions: 20000
Failed transactions: 0
Longest transaction: 0.06
Shortest transaction: 0.00

License
-------

[](#license)

Released under the MIT License.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 90.6% 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 ~73 days

Recently: every ~41 days

Total

16

Last Release

3536d ago

Major Versions

v1.1.1 → v2.0.02014-12-09

v1.x-dev → v3.x-dev2016-09-12

PHP version history (2 changes)v1.0.0PHP &gt;=5.3

v3.x-devPHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/765a863c426744d47fb2a72ba44a64078e9e946e3e8b8c21daf5da007e4a3200?d=identicon)[ricardoper](/maintainers/ricardoper)

---

Top Contributors

[![ricardoper](https://avatars.githubusercontent.com/u/5161172?v=4)](https://github.com/ricardoper "ricardoper (96 commits)")[![GDmac](https://avatars.githubusercontent.com/u/156334?v=4)](https://github.com/GDmac "GDmac (9 commits)")[![jguyomard](https://avatars.githubusercontent.com/u/1242207?v=4)](https://github.com/jguyomard "jguyomard (1 commits)")

---

Tags

phpoauthtwitterAPI v1.1

### Embed Badge

![Health badge](/badges/ricardoper-twitteroauth/health.svg)

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

###  Alternatives

[socialconnect/auth

Social Connect Auth Component

568845.4k5](/packages/socialconnect-auth)[artdarek/oauth-4-laravel

OAuth Service Provider for Laravel 4

693504.8k](/packages/artdarek-oauth-4-laravel)[and/oauth

Simple and amazing OAuth library with many providers. Just try it out!

4645.2k2](/packages/and-oauth)[lorenzoferrarajr/lfj-opauth

LfjOpauth is a Zend Framework 2 module that enables support for many authentication providers through the Opauth framework.

2915.4k](/packages/lorenzoferrarajr-lfj-opauth)

PHPackages © 2026

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