PHPackages                             philbone/twittersearch - 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. philbone/twittersearch

ActivePackage

philbone/twittersearch
======================

A package for Twitter search API.

09PHP

Since May 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/philbone/twittersearch)[ Packagist](https://packagist.org/packages/philbone/twittersearch)[ RSS](/packages/philbone-twittersearch/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (1)Used By (0)

About Switter
=============

[](#about-switter)

[![Build Status](https://camo.githubusercontent.com/14781e6fa9c58b3c5c2444b04be9311d6a2d33d795cf6a6b8364c473e063ce22/68747470733a2f2f7472617669732d63692e6f72672f7068696c626f6e652f747769747465727365617263682e737667)](https://travis-ci.org/philbone/twittersearch)

Switter is a package for Twitter search API.

Index
-----

[](#index)

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [How to use](#how-to-use)
    1. [Example](#example-)
4. [Running a Test](#how-to-run-test-searchtest-php)

### Requirements

[](#requirements)

- PHP 7.1 or higer.
- [Guzzle](https://github.com/guzzle/guzzle) PHP HTTP client.
- Twitter API Keys from [Twitter Apps](https://apps.twitter.com/)

### Installation

[](#installation)

Clone repository from GitHub

```
$ git clone https://github.com/philbone/twittersearch.git switter

```

Inside the directory where Switter is installed, open the terminal and run "composer install" to get the dependencies.

```
$ composer install

```

### How to use

[](#how-to-use)

- Import definition.
- Make a new object from Search class.
- Set token with your API keys.
- Set some value to search.
- Search the value.

#### Example:

[](#example)

```
use Twitter\Search\Search;

$apiKey = "jLl8hRLXY3xEPHGnx7UndxrcV"; // replace with your own api key.
$apiSecret = "8erBjpOra7GCGkHOK3YbTcqoKTQBSyKgljgG4MCDZi5cKRb7op"; // replace with your own api secret.

$search = new Search();

$search->setToken($apiKey, $apiSecret);

$value = ["q" => "#PHP #Composer"];

$response = $search->search($value);

var_dump($response);

```

A detailed test example can be found in test/SearchTest.php. Pay special attention to the sample method "testSuccessSearch".

### How to run Test SearchTest.php

[](#how-to-run-test-searchtestphp)

Assuming that PHPUnit was installed as a dependency, simply open the terminal from the directory where Switter is installed and run it:

```
$ phpunit

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/967a921f33e476f9cafeb5f8a12725e17828009a6e1b5e1af28a06b3375810da?d=identicon)[philbone](/maintainers/philbone)

---

Top Contributors

[![philbone](https://avatars.githubusercontent.com/u/15118498?v=4)](https://github.com/philbone "philbone (20 commits)")

### Embed Badge

![Health badge](/badges/philbone-twittersearch/health.svg)

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

PHPackages © 2026

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