PHPackages                             hkirsman/google-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. hkirsman/google-search-console

ActiveLibrary[API Development](/categories/api)

hkirsman/google-search-console
==============================

Wrapper for google/apiclient to access and retrieve data from Google Search Console.

911.1k↓70%[1 PRs](https://github.com/hkirsman/hkirsman-google-search-console/pulls)

Since Sep 6Compare

[ Source](https://github.com/hkirsman/hkirsman-google-search-console)[ Packagist](https://packagist.org/packages/hkirsman/google-search-console)[ RSS](/packages/hkirsman-google-search-console/feed)WikiDiscussions Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

hkirsman/google-search-console
==============================

[](#hkirsmangoogle-search-console)

Wrapper for google/apiclient to access and retrieve data from Google Search Console using PHP. You can find this project in both  and

Installation (using Composer)
-----------------------------

[](#installation-using-composer)

Add hkirsman/google-search-console to your project:

```
composer require hkirsman/google-search-console:dev-master

```

Get key from . There you have to create a project if you don't have it already, enable the 'Google Search Console API' and create 'Service account key' (json format). Add this keyfile to your project root or define custom path like this:

```
$searchConsole = new SearchConsoleApi('/foo/bar/service-account.json');

```

instead of just

```
$searchConsole = new SearchConsoleApi();

```

You'll also have to get Service account ID () and add it as user in the .

Example
-------

[](#example)

Try this example file. Replace `http://www.example.com/` with your url and also `'expression' => '/SUBPATH/',`

```
