PHPackages                             zanysoft/laravel-serpapi - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. zanysoft/laravel-serpapi

ActiveLibrary[HTTP &amp; Networking](/categories/http)

zanysoft/laravel-serpapi
========================

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

1.0.1(2y ago)2795[1 issues](https://github.com/zanysoft/laravel-serpapi/issues)MITPHPPHP &gt;=5.5CI passing

Since Aug 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/zanysoft/laravel-serpapi)[ Packagist](https://packagist.org/packages/zanysoft/laravel-serpapi)[ Docs](http://github.com/zanysoft/laravel-serpapi)[ RSS](/packages/zanysoft-laravel-serpapi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

laravel-serpapi
===============

[](#laravel-serpapi)

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

[![Latest Stable Version](https://camo.githubusercontent.com/9b1d339422f7f77f8f7d2eed56a46736b16ad628a1c650192dcaa11632373408/68747470733a2f2f706f7365722e707567782e6f72672f7a616e79736f66742f6c61726176656c2d736572706170692f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/zanysoft/laravel-serpapi)[![MIT License](https://camo.githubusercontent.com/30597ff9a350144f03bffdd9183e16468e0b3ca1193e1d08591d992622738d55/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://www.opensource.org/licenses/MIT)[![Build Status](https://camo.githubusercontent.com/651404919b644f4af2db22a4d4ed6ad4c5448894954d5bc1d2d2ec716c7e588f/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f7a616e79736f66742f6c61726176656c2d736572706170692e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/zanysoft/laravel-serpapi)[![Quality Score](https://camo.githubusercontent.com/c3212b980fdf14b2d52c3f8453a3cc90178b44af7499d54c02508ddecc5765a0/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7a616e79736f66742f6c61726176656c2d736572706170692f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/zanysoft/laravel-serpapi/)[![Total Downloads](https://camo.githubusercontent.com/7f833dbf8ffa31691072d540174fe76c2ef381fcda3202546af24708502ea87f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a616e79736f66742f6c61726176656c2d736572706170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zanysoft/laravel-serpapi)

This is where your description should go.

### Installation

[](#installation)

You can install the package via composer:

```
composer require zanysoft/laravel-serpapi
```

### Configuration

[](#configuration)

You can publish the config file with:

```
php artisan vendor:publish --provider="ZanySoft\LaravelSerpApi\SerpApiServiceProvider" --tag="serpapi-config"
```

This is the contents of the published config file:

```
return [
    'api_key' => env('SERPAPI_API_KEY'),
    'search_engine' => env('SERPAPI_ENGINE', 'google')
];
```

Get "your api key" from

### Usage

[](#usage)

Then you can start coding something like:

```
use ZanySoft\LaravelSerpApi\Facades\SerpApi;

$client = SerpApi::GoogleSearch();
$query = ["q" => "coffee","location"=>"Austin,Texas"];
$response = $client->get_json($query);
print_r($response)
```

Alternatively, you can search:

- Bing using `SerpApi::BingSearch()`
- Baidu using `SerpApi::BaiduSearch()`
- Ebay using `SerpApi::EbaySearch()`
- Yahoo using `SerpApi::YahooSearch()`
- Yandex using `SerpApi::YandexSearch()`
- Walmart using `SerpApi::WalmartSearch()`
- Youtube using `SerpApi::YoutubeSearch()`
- HomeDepot using `SerpApi::Search($engine)`
- Apple App Store using `SerpApi::Search($engine)`
- Naver using `SerpApi::NaverSearch()`

See the playground to generate your code.

### Examples

[](#examples)

#### Search API capability

[](#search-api-capability)

```
use ZanySoft\LaravelSerpApi\Facades\SerpApi;

$client = SerpApi::GoogleSearch();

$query = [
  "q" =>  "query",
  "google_domain" =>  "Google Domain",
  "location" =>  "Location Requested",
  "device" =>  "device",
  "hl" =>  "Google UI Language",
  "gl" =>  "Google Country",
  "safe" =>  "Safe Search Flag",
  "num" =>  "Number of Results",
  "start" =>  "Pagination Offset",
  "serp_api_key" =>  "Your SERP API Key",
  "tbm" => "nws|isch|shop"
  "tbs" => "custom to be search criteria"
  "async" => true|false # allow async
];

$html_results = $client->get_html($query);
$json_results = $client->get_json($query);
```

#### Location API

[](#location-api)

```
use ZanySoft\LaravelSerpApi\Facades\SerpApi;

$client = SerpApi::GoogleSearch();

$location_list = $client->get_location('Austin', 3);
print_r($location_list);
```

it prints the first 3 location matching Austin (Texas, Texas, Rochester)

```
[{:id=>"585069bdee19ad271e9bc072",
  :google_id=>200635,
  :google_parent_id=>21176,
  :name=>"Austin, TX",
  :canonical_name=>"Austin,TX,Texas,United States",
  :country_code=>"US",
  :target_type=>"DMA Region",
  :reach=>5560000,
  :gps=>[-97.7430608, 30.267153],
  :keys=>["austin", "tx", "texas", "united", "states"]},
  ...]
```

#### Account API

[](#account-api)

```
use ZanySoft\LaravelSerpApi\Facades\SerpApi;

$client = SerpApi::GoogleSearch();

$info = $client->get_account();
print_r($info);
```

it prints your account information.

#### Search Google Images

[](#search-google-images)

```
use ZanySoft\LaravelSerpApi\Facades\SerpApi;

$client = SerpApi::GoogleSearch();
$data = $client->get_json([
  'q' => "Coffee",
  'tbm' => 'isch'
]);

foreach($data->images_results as $image_result) {
  print_r($image_result->original);
}
```

this code prints all the images links

Conclusion
----------

[](#conclusion)

SerpApi supports all the major search engines. Google has the more advance support with all the major services available: Images, News, Shopping and more.. To enable a type of search, the field tbm (to be matched) must be set to:

- isch: Google Images API.
- nws: Google News API.
- shop: Google Shopping API.
- any other Google service should work out of the box.
- (no tbm parameter): regular Google search. The field tbs allows to customize the search even more.

[The full documentation is available here.](https://serpapi.com/search-api)

### License

[](#license)

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance23

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1007d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77060551?v=4)[Mubashar Ahmad (مبشر احمد)](/maintainers/mubasharahmad)[@MubasharAhmad](https://github.com/MubasharAhmad)

---

Top Contributors

[![zanysoft](https://avatars.githubusercontent.com/u/2682072?v=4)](https://github.com/zanysoft "zanysoft (2 commits)")

---

Tags

baidubingebaygooglelaravel-serpserpserpapiyahooyoutubejsonapisearchrestxmlcurlgoogleyoutuberesultwalmartappleyandexSERPserpapinaverduckduckgohomedepot

### Embed Badge

![Health badge](/badges/zanysoft-laravel-serpapi/health.svg)

```
[![Health](https://phpackages.com/badges/zanysoft-laravel-serpapi/health.svg)](https://phpackages.com/packages/zanysoft-laravel-serpapi)
```

###  Alternatives

[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69114.3k](/packages/serpapi-google-search-results-php)[tcdent/php-restclient

A generic REST API client for PHP

3542.9M29](/packages/tcdent-php-restclient)[arhitector/yandex

PHP SDK для работы с некоторыми сервисами яндекса (Яндекс.Диск, Yandex.Disk)

13082.9k5](/packages/arhitector-yandex)[vinelab/http

An http library developed for the laravel framework. aliases itself as HttpClient

59300.2k11](/packages/vinelab-http)[serpwow/google-search-results

Google Search Results PHP package via SerpWow.com

1931.8k1](/packages/serpwow-google-search-results)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)

PHPackages © 2026

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