PHPackages                             spatie/googlesearch - 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. [Search &amp; Filtering](/categories/search)
4. /
5. spatie/googlesearch

AbandonedArchivedLibrary[Search &amp; Filtering](/categories/search)

spatie/googlesearch
===================

Get searchresults from a Google Custom Search Engine

2.0.3(9y ago)815.9k291MITPHPPHP &gt;=5.6.0

Since May 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/spatie/googlesearch)[ Packagist](https://packagist.org/packages/spatie/googlesearch)[ Docs](https://github.com/spatie/googlesearch)[ RSS](/packages/spatie-googlesearch/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (3)Versions (14)Used By (1)

Get searchresults from a Google Custom Search Engine
====================================================

[](#get-searchresults-from-a-google-custom-search-engine)

[![Latest Version](https://camo.githubusercontent.com/bb997ebc68f4990addc4c0f1c6b9528935051ae673a319ddcff107988559fa20/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7370617469652f676f6f676c657365617263682e7376673f7374796c653d666c61742d737175617265)](https://github.com/spatie/googlesearch/releases)[![Build status](https://camo.githubusercontent.com/a7b7179736e873f77028e3dfdf141694ad91b67cfa7f8f6bd65117a30c18a9b5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370617469652f676f6f676c657365617263682e737667)](https://travis-ci.org/spatie/googlesearch)[![SensioLabsInsight](https://camo.githubusercontent.com/f3e7a919408f881de407db4d5f83074318460e9bbe287a3f7af1d89d0f2cd936/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f39643562663734632d326363302d343262642d393830302d3562653263326630333462372e737667)](https://insight.sensiolabs.com/projects/9d5bf74c-2cc0-42bd-9800-5be2c2f034b7)[![Quality Score](https://camo.githubusercontent.com/2a2ee0a9b0d3807249cb72eb756e1d4e07d6371c2236835f1c052c44e003245b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f676f6f676c657365617263682e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/googlesearch)[![StyleCI](https://camo.githubusercontent.com/d582c0a731d4caa7e3364399e2df3c952c2c325832f1bcc64a17901f450d8969/68747470733a2f2f7374796c6563692e696f2f7265706f732f31393339313531362f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/19391516)[![Total Downloads](https://camo.githubusercontent.com/a35de9115b15cdf7ed0ac54a7366012a9b09cf305eb11e344e6d383c9fb12f71/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f676f6f676c657365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/googlesearch)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package can fetch results for the paid version of a Google Custom Search Engine. It returns an array with searchresults. You'll need to know [how to set up a Google Custom Search Engine](https://support.google.com/customsearch/answer/2630963?hl=en).

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Laravel compatibility
---------------------

[](#laravel-compatibility)

Laravelgooglesearch4.2.x1.x5.x2.xPostcardware
------------

[](#postcardware)

You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

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

[](#installation)

This package can be installed through Composer.

```
composer require spatie/googlesearch
```

When using Laravel there is a service provider that you can make use of.

```
// Laravel 5: config/app.php

'providers' => [
    '...',
    'Spatie\GoogleSearch\GoogleSearchServiceProvider'
];
```

GoogleSearch also comes with a facade, which provides an easy way to call the the class.

```
// Laravel 5: config/app.php

'aliases' => [
	...
	'GoogleSearch' => 'Spatie\GoogleSearch\Facades\GoogleSearch',
	...
]
```

You can publish the config file of the package using artisan

```
php artisan vendor:publish --provider="Spatie\GoogleSearch\GoogleSearchServiceProvider"
```

This command creates a file within your config directory in which you can specify the id of the Custom Search Engine you want to use.

Usage
-----

[](#usage)

Here is a sample call to get search results:

```
/*
  This function returns an array with keys

  "name"     // the name of the found page
  "url"      // the url of the found page
  "snippet"  // a little piece of text found on the page
*/

$searchResults = GoogleSearch::getResults('The meaning of life'); // is 42
```

When no results are found an empty array is returned.

About Spatie
------------

[](#about-spatie)

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~80 days

Recently: every ~150 days

Total

12

Last Release

3507d ago

Major Versions

0.2.3 → 1.0.02015-02-12

1.0.0 → 2.0.02015-02-12

PHP version history (3 changes)0.1.0PHP &gt;=5.4.0

0.1.3PHP &gt;=5.3.0

2.0.3PHP &gt;=5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (72 commits)")[![MatthiasDeWinter](https://avatars.githubusercontent.com/u/8791525?v=4)](https://github.com/MatthiasDeWinter "MatthiasDeWinter (2 commits)")[![hansvn](https://avatars.githubusercontent.com/u/3542686?v=4)](https://github.com/hansvn "hansvn (1 commits)")[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (1 commits)")[![rkeppner](https://avatars.githubusercontent.com/u/3485765?v=4)](https://github.com/rkeppner "rkeppner (1 commits)")[![Tjoosten](https://avatars.githubusercontent.com/u/5157609?v=4)](https://github.com/Tjoosten "Tjoosten (1 commits)")

---

Tags

searchlaravelgoogleenginecustom

### Embed Badge

![Health badge](/badges/spatie-googlesearch/health.svg)

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

###  Alternatives

[jan-drda/laravel-google-custom-search-engine

Laravel package to get Google Custom Search results from Google Custom Search Engine API for both free and paid version.

5036.7k](/packages/jan-drda-laravel-google-custom-search-engine)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)

PHPackages © 2026

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