PHPackages                             oriceon/laravel-search-console - 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. oriceon/laravel-search-console

ActiveLibrary[API Development](/categories/api)

oriceon/laravel-search-console
==============================

A Laravel package to retrieve data from Google Search Console

1.0.5(2mo ago)126MITPHPPHP ^8.0.2

Since Mar 12Pushed 2mo agoCompare

[ Source](https://github.com/oriceon/laravel-search-console)[ Packagist](https://packagist.org/packages/oriceon/laravel-search-console)[ Docs](https://github.com/schulzefelix/laravel-search-console)[ RSS](/packages/oriceon-laravel-search-console/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (12)Versions (6)Used By (0)

Laravel Search Console
======================

[](#laravel-search-console)

[![Latest Version](https://camo.githubusercontent.com/809906ce148ea59b977455f7aabd2bcd526f6be862e14455ee838868d180d796/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f736368756c7a6566656c69782f6c61726176656c2d7365617263682d636f6e736f6c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/schulzefelix/laravel-search-console/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/aa8450be0335544aba51d761466b778c960a6863a5ce5a2e121f78b8e1ee6e25/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736368756c7a6566656c69782f6c61726176656c2d7365617263682d636f6e736f6c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/schulzefelix/laravel-search-console)[![Quality Score](https://camo.githubusercontent.com/5711a1b2dc9ab4e7ab04edafe973d54898a813684cb03a5e39bcc7715ca2b3d4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736368756c7a6566656c69782f6c61726176656c2d7365617263682d636f6e736f6c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/schulzefelix/laravel-search-console)[![StyleCI](https://camo.githubusercontent.com/4de16456255dfb0053dbb348dc5ec891fa90b156950681401cbad3e076288188/68747470733a2f2f7374796c6563692e696f2f7265706f732f39373731303033322f736869656c64)](https://styleci.io/repos/97710032)[![Latest Version on Packagist](https://camo.githubusercontent.com/ea955e804b4181b190e9ada8fa9750a3f06a27f79aa033c9688ebea66cbe42c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736368756c7a6566656c69782f6c61726176656c2d7365617263682d636f6e736f6c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/schulzefelix/laravel-search-console)[![Total Downloads](https://camo.githubusercontent.com/1eb91bdd4e08ff34cd2d2d1ef9d42f5af3a5f8016ffb306d0e1c47d17d2f384e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736368756c7a6566656c69782f6c61726176656c2d7365617263682d636f6e736f6c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/schulzefelix/laravel-search-console)

Using this package you can easily retrieve data from Google Search Console API.

Here are a few examples of the provided methods:

```
use SearchConsole;

//list all available sites for that token
SearchConsole::setAccessToken($token)->listSites();

//get site details (permissionLevel) for specific site
SearchConsole::setAccessToken($token)->getSite('http://blog.example.com/');
```

Install
-------

[](#install)

This package can be installed through Composer.

```
$ composer require schulzefelix/laravel-search-console
```

Optionally, you can publish the config file of this package with this command:

```
php artisan vendor:publish --provider="SchulzeFelix\SearchConsole\SearchConsoleServiceProvider"
```

The following config file will be published in `config/search-console.php`

```
return [

    /*
    |--------------------------------------------------------------------------
    | Authentication
    |--------------------------------------------------------------------------
    | Google offers access via OAuth client IDs or service accounts.
    | For more information see: https://developers.google.com/identity/protocols/OAuth2
    |
    | Supported: "oauth", "oauth_json", "service_account",
    */

    'auth_type' => env('GOOGLE_AUTH_TYPE', 'oauth'),

    /*
    |--------------------------------------------------------------------------
    | Application Credentials
    |--------------------------------------------------------------------------
    |
    | https://developers.google.com/api-client-library/php/auth/service-accounts#creatinganaccount
    */

    'connections' => [

        'oauth' => [
            'client_id' => env('GOOGLE_CLIENT_ID'),
            'client_secret' => env('GOOGLE_CLIENT_SECRET'),
        ],

        'oauth_json' => [
            'auth_config' => storage_path('app/searchconsole/oauth-account-credentials.json'),
        ],

        'service_account' => [
            'application_credentials' => storage_path('app/searchconsole/service-account-credentials.json'),
        ],

    ],

    /*
     |--------------------------------------------------------------------------
     | Cache Settings
     |--------------------------------------------------------------------------
     | Here you may configure the "store" that the underlying Google_Client will
     | use to store it's data.  You may also add extra parameters that will
     | be passed on setCacheConfig (see docs for google-api-php-client).
     |
     | Optional parameters: "lifetime", "prefix"
     */

    'cache' => [
        'store' => 'file',
    ],

    /*
    |--------------------------------------------------------------------------
    | Application Name
    |--------------------------------------------------------------------------
    */

    'application_name' => env('SEARCH_CONSOLE_APPLICATION_NAME', 'GSC Agent'),
];
```

Usage
-----

[](#usage)

Here are two basic example to retrieve all sites and an export for search analytics data.

### List Sites

[](#list-sites)

```
$sites = SearchConsole::setAccessToken($token)->listSites();
```

### Search Analytics

[](#search-analytics)

```
use SearchConsole;
use SchulzeFelix\SearchConsole\Period;

    $data = SearchConsole::setAccessToken($token)->setQuotaUser('uniqueQuotaUserString')
        ->searchAnalyticsQuery(
            'https://www.example.com/',
            Period::create(Carbon::now()->subDays(30), Carbon::now()->subDays(2)),
            ['query', 'page', 'country', 'device', 'date'],
            [['dimension' => 'query', 'operator' => 'notContains', 'expression' => 'cheesecake']],
            1000,
            'web',
            'all',
            'auto'
        );
```

Provided methos
---------------

[](#provided-methos)

### Retrieve One Site

[](#retrieve-one-site)

```
public function public function getSite(string $siteUrl): array
```

### Retrieve All Sites

[](#retrieve-all-sites)

```
public function public function listSites(): Collection
```

### Retrieve Search Analytics Data

[](#retrieve-search-analytics-data)

```
public function searchAnalyticsQuery(string $siteUrl, Period $period, array $dimensions = [], array $filters = [], int $rows = 1000, string $searchType = 'web', string $dataState = 'final', string $aggregationType = 'auto'): Collection
```

### Check Access Token

[](#check-access-token)

```
public function public function isAccessTokenExpired(): Bool
```

Provided fluent configuration
-----------------------------

[](#provided-fluent-configuration)

### Set Access Token (Required)

[](#set-access-token-required)

```
$sites = SearchConsole::setAccessToken($token)->listSites();
```

### Set Quota User

[](#set-quota-user)

To avoid to the API limits, you can provide a unique string for the authenticated account.

More information:

```
$sites = SearchConsole::setAccessToken($token)->setQuotaUser('uniqueQuotaUserString')->listSites();
```

Get Underlying Service
----------------------

[](#get-underlying-service)

You can get access to the underlying `Google_Service_Webmasters` object:

```
SearchConsole::getWebmastersService();
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Felix Schulze](https://github.com/schulzefelix)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance88

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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 ~182 days

Total

5

Last Release

62d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a9692bf91992f959404944cecec65e1b68b21491ec3c5642e67e47a836d9ea8?d=identicon)[oriceon](/maintainers/oriceon)

---

Top Contributors

[![schulzefelix](https://avatars.githubusercontent.com/u/8378750?v=4)](https://github.com/schulzefelix "schulzefelix (45 commits)")[![oriceon](https://avatars.githubusercontent.com/u/358823?v=4)](https://github.com/oriceon "oriceon (8 commits)")[![madeITBelgium](https://avatars.githubusercontent.com/u/20304892?v=4)](https://github.com/madeITBelgium "madeITBelgium (3 commits)")[![vesper8](https://avatars.githubusercontent.com/u/816028?v=4)](https://github.com/vesper8 "vesper8 (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

laravelgooglewebmaster toolslaravel-search-consolesearch console

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oriceon-laravel-search-console/health.svg)

```
[![Health](https://phpackages.com/badges/oriceon-laravel-search-console/health.svg)](https://phpackages.com/packages/oriceon-laravel-search-console)
```

###  Alternatives

[schulzefelix/laravel-search-console

A Laravel package to retrieve data from Google Search Console

5037.8k1](/packages/schulzefelix-laravel-search-console)[revolution/laravel-google-sheets

Google Sheets API v4

4483.1M6](/packages/revolution-laravel-google-sheets)[pulkitjalan/google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support

2582.9M5](/packages/pulkitjalan-google-apiclient)[thujohn/analytics

Google Analytics for Laravel 4

113108.7k1](/packages/thujohn-analytics)[scottybo/laravel-google-my-business

A package for Laravel which implements the Google My Business API

3360.3k](/packages/scottybo-laravel-google-my-business)

PHPackages © 2026

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