PHPackages                             silktide/semrush-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. silktide/semrush-api

AbandonedArchivedLibrary

silktide/semrush-api
====================

SEMrush API client

1.7.2(4y ago)1417.4k↓100%20[1 issues](https://github.com/silktide/semrush-api/issues)GPL-2.0-or-laterPHPPHP &gt;=7.4

Since Mar 30Pushed 3y ago11 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (36)Used By (0)

SEMrush API client
==================

[](#semrush-api-client)

[![Build Status](https://camo.githubusercontent.com/bdff578fb68deb0ee2cba3cd2f76f76a702d0a420aa83c7649ac41f79b17fa3a/68747470733a2f2f7472617669732d63692e6f72672f73696c6b746964652f73656d727573682d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/silktide/semrush-api)[![Code Climate](https://camo.githubusercontent.com/415123d008b3a7f994b390dd03a01d82f67cae964c5d5d587e13f20f08cd48e2/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f73696c6b746964652f73656d727573682d6170692f6261646765732f6770612e737667)](https://codeclimate.com/github/silktide/semrush-api)[![Test Coverage](https://camo.githubusercontent.com/1d57a581454f59a92c51fc6e1f80590517784a3d58df13c7bb1fdc5c7daa8fd5/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f73696c6b746964652f73656d727573682d6170692f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/silktide/semrush-api)

A PHP API client for the SEMrush API.

Supported actions:
------------------

[](#supported-actions)

- domain\_ranks
- domain\_domains
- domain\_rank
- domain\_rank\_history
- domain\_organic
- domain\_adwords
- domain\_adwords\_unique
- advertiser\_publishers
- advertiser\_text\_ads
- advertiser\_rank
- phrase\_this ([https://www.semrush.com/api-analytics/#phrase\_this](https://www.semrush.com/api-analytics/#phrase_this))

Usage
-----

[](#usage)

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

[](#installation)

```
    composer require silktide/semrush-api

```

Setup
-----

[](#setup)

This library was designed to use Dependency Injection (DI). If you don't use DI, you could use the factory to set up the API client:

```
    $client = \Silktide\SemRushApi\ClientFactory::create("[YOUR SEMRUSH API KEY]");
```

Caching
-------

[](#caching)

The API library can use a PSR-16 style cache to reduce calls to the API.

```
    $cache = new Psr16CompliantCache();
    $client->setCache($cache)
```

API calls
---------

[](#api-calls)

### Domain ranks

[](#domain-ranks)

Getting the SEMrush "domain\_ranks" for a website:

```
    $result = $client->getDomainRanks('silktide.com');
```

### Domain rank

[](#domain-rank)

Getting the SEMrush "domain\_rank" for a website:

```
    $result = $client->getDomainRank(
        'silktide.com',
        [
            'database' => \Silktide\SemRushApi\Data\Database::DATABASE_GOOGLE_US
        ]
    );
```

### Domain rank history

[](#domain-rank-history)

Getting the SEMrush "domain\_rank\_history" for a website:

```
    $result = $client->getDomainRankHistory(
        'silktide.com',
        [
            'database' => \Silktide\SemRushApi\Data\Database::DATABASE_GOOGLE_US
        ]
    );
```

### Domain organic

[](#domain-organic)

Getting the SEMrush "domain\_organic" for a website:

```
    $result = $client->getDomainOrganic(
        'silktide.com',
        [
            'database' => \Silktide\SemRushApi\Data\Database::DATABASE_GOOGLE_US
        ]
    );
```

### Domain adwords

[](#domain-adwords)

Getting the SEMrush "domain\_adwords" for a website:

```
    $result = $client->getDomainAdwords(
        'silktide.com',
        [
            'database' => \Silktide\SemRushApi\Data\Database::DATABASE_GOOGLE_US
        ]
    );
```

### Domain adwords unique

[](#domain-adwords-unique)

Getting the SEMrush "domain\_adwords\_unique" for a website:

```
    $result = $client->getDomainAdwordsUnique(
        'silktide.com',
        [
            'database' => \Silktide\SemRushApi\Data\Database::DATABASE_GOOGLE_US
        ]
    );
```

Using options
-------------

[](#using-options)

Here's an example of passing options to the domain ranks action in order to return a specific set of columns.

```
    $result = $client->getDomainRanks('silktide.com', [
        'export_columns' => [
            \Silktide\SemRushApi\Data\Column::COLUMN_OVERVIEW_ADWORDS_BUDGET,
            \Silktide\SemRushApi\Data\Column::COLUMN_OVERVIEW_ADWORDS_KEYWORDS,
            \Silktide\SemRushApi\Data\Column::COLUMN_OVERVIEW_ADWORDS_TRAFFIC
         ]
    ]);
```

Using results
-------------

[](#using-results)

All API actions will return a `Result` object. Result objects contain a number of `Row` objects and are iterable and countable. Here's a (non exhaustive) example of how they can be used.

```
    foreach ($result as $row) {
        $budget = $row->getValue(\Silktide\SemRushApi\Data\Column::COLUMN_OVERVIEW_ADWORDS_BUDGET);
        echo "\nThe AdWords spend of this site in the last month was an estimated ${$budget}";
    }
```

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~85 days

Recently: every ~24 days

Total

31

Last Release

1509d ago

Major Versions

0.9.0 → 1.0.02018-01-18

PHP version history (5 changes)0.1.0PHP &gt;=5.5.0

0.7.0PHP &gt;=5.6.0

1.0.0PHP &gt;=7.0

1.3.0PHP &gt;=7.1

1.6.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/194d1fe23e2566b3c00d0edf69239351d6c7b442abb17c8e92f8f4d1b58945af?d=identicon)[Dolondro](/maintainers/Dolondro)

![](https://www.gravatar.com/avatar/2eca248b997f71d4d1ec2059f5ab6022663ff2990c9924cdf4136784438d0971?d=identicon)[silktide](/maintainers/silktide)

![](https://www.gravatar.com/avatar/df3b84c45fff8328d8900997e87a215e1e538cfea47be8872fa1c4e35afbffbc?d=identicon)[andywaite](/maintainers/andywaite)

---

Top Contributors

[![andywaite](https://avatars.githubusercontent.com/u/6773151?v=4)](https://github.com/andywaite "andywaite (99 commits)")[![dochne](https://avatars.githubusercontent.com/u/1678803?v=4)](https://github.com/dochne "dochne (15 commits)")[![piiupilt](https://avatars.githubusercontent.com/u/21039211?v=4)](https://github.com/piiupilt "piiupilt (10 commits)")[![michaelaguiar](https://avatars.githubusercontent.com/u/138890?v=4)](https://github.com/michaelaguiar "michaelaguiar (3 commits)")[![leepercox](https://avatars.githubusercontent.com/u/6492146?v=4)](https://github.com/leepercox "leepercox (2 commits)")[![louist7](https://avatars.githubusercontent.com/u/16017032?v=4)](https://github.com/louist7 "louist7 (1 commits)")[![adjohu](https://avatars.githubusercontent.com/u/655857?v=4)](https://github.com/adjohu "adjohu (1 commits)")[![jb000](https://avatars.githubusercontent.com/u/17474154?v=4)](https://github.com/jb000 "jb000 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/silktide-semrush-api/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M16.9k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k17](/packages/civicrm-civicrm-core)[nutgram/nutgram

The Telegram bot library that doesn't drive you nuts

714214.9k8](/packages/nutgram-nutgram)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M385](/packages/shopware-core)

PHPackages © 2026

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