PHPackages                             merlinoff/similar-web-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. merlinoff/similar-web-api

ActiveLibrary[API Development](/categories/api)

merlinoff/similar-web-api
=========================

API for SimilarWeb is a project created by SimilarGroup company. It collects and provides access to various website analytics. This is a PHP library implementing easy access to their API.

09PHP

Since Mar 26Pushed 11y ago1 watchersCompare

[ Source](https://github.com/druidoff/similar-web-api)[ Packagist](https://packagist.org/packages/merlinoff/similar-web-api)[ RSS](/packages/merlinoff-similar-web-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SimilarWeb API PHP Client
=========================

[](#similarweb-api-php-client)

Introduction
------------

[](#introduction)

[SimilarWeb](http://www.similarweb.com) is a project created by [SimilarGroup](http://www.similargroup.com) company. It collects and provides access to various website analytics. This is a PHP library implementing easy access to their [API](https://developer.similarweb.com/).

Requirements:
-------------

[](#requirements)

- PHP 5.3 (namespaces),
- [php-curl-class](https://github.com/php-curl-class/php-curl-class) library (Curl request lib).

Installation:
-------------

[](#installation)

This library is available on [Packagist](https://github.com/druidoff/similar-web-api) and uses `merlinoff/SimilarWebApi` alias. If you use [Composer](https://getcomposer.org/) (and if you don't I don't know what you're waiting for) you can `composer require` it:

```
composer require merlinoff/similar-web-api

```

Alternatively you can place it manually inside your `composer.json`:

```
(...)
"require": {
    "merlinoff/similar-web-api": "dev-master"
}
(...)

```

and then run `composer install` or `composer update` as required.

You can of course make it a [git submodule](http://git-scm.com/docs/git-submodule), download and place it in your project next to your regular code or something, but really, do yourself (and the whole industry) a favor and use Composer.

Usage:
------

[](#usage)

All APIs implemented in this library have the Request and Response classes named corresponding to those defined in SimilarWeb API documentation. Expected data should be retrieved by first visiting SimilarWeb API documentation and then using Request class with the same name located in `src/Request` directory. Method `getResponse()` demonstrated below will automatically match, create and return matching Response class object which can be type hinted and relied on. There is also ClientFacade class which contains easy to use interface (note that this class is auto-generated):

```
use merlinoff\SimilarWeb;

// create client object
$sw = new SimilarWeb($token);
$sw->setDomain("google.com");

// fetch response by passing API call name and desired domain
$result = $sw->getRankAndReach();

// or get category rank
$result = $sw->getCategoryRank();

// or get Traffic
$result = $sw->getTraffic("9-2014", "2-2015");

etc...
```

APIs return objects with keys containing four types of data:

During either `composer install`, `composer update` or manual execution of `php bin/generate` command, API mapping configuration is used to generate domain request and response classes with methods hiding library complexity behind readable accessors. Such approach makes it possible to have readable class API, good IDE autocompletion and highlighting possibilities with no additional programming work. When response is parsed all elements of given type are put inside their containers and those response classes act as a facade for raw response object.

License
-------

[](#license)

GNU General Public License

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/eb09e2b06ed65b199051f9667d5890bca10d19d5a375fdfecf8c7b2c7b1e77cc?d=identicon)[druidoff](/maintainers/druidoff)

### Embed Badge

![Health badge](/badges/merlinoff-similar-web-api/health.svg)

```
[![Health](https://phpackages.com/badges/merlinoff-similar-web-api/health.svg)](https://phpackages.com/packages/merlinoff-similar-web-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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