{"id":28438082,"url":"https://github.com/zanysoft/laravel-serpapi","last_synced_at":"2025-06-28T15:31:28.051Z","repository":{"id":188466955,"uuid":"678810589","full_name":"zanysoft/laravel-serpapi","owner":"zanysoft","description":"Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com","archived":false,"fork":false,"pushed_at":"2025-02-18T12:02:27.000Z","size":13,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T00:43:11.864Z","etag":null,"topics":["baidu","bing","ebay","google","laravel-serp","serp","serpapi","yahoo","youtube"],"latest_commit_sha":null,"homepage":"https://zanysoft.github.io/laravel-serpapi/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zanysoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-15T12:39:56.000Z","updated_at":"2025-02-28T11:51:27.000Z","dependencies_parsed_at":"2023-08-15T13:32:45.477Z","dependency_job_id":null,"html_url":"https://github.com/zanysoft/laravel-serpapi","commit_stats":null,"previous_names":["zanysoft/laravel-serpapi"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zanysoft/laravel-serpapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-serpapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-serpapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-serpapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-serpapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zanysoft","download_url":"https://codeload.github.com/zanysoft/laravel-serpapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-serpapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262452268,"owners_count":23313409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baidu","bing","ebay","google","laravel-serp","serp","serpapi","yahoo","youtube"],"created_at":"2025-06-06T00:39:09.020Z","updated_at":"2025-06-28T15:31:28.038Z","avatar_url":"https://github.com/zanysoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel-serpapi\nGet Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com\n\n[![Latest Stable Version](https://poser.pugx.org/zanysoft/laravel-serpapi/v/stable?format=flat-square)](https://packagist.org/packages/zanysoft/laravel-serpapi)\n[![MIT License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://www.opensource.org/licenses/MIT)\n[![Build Status](http://img.shields.io/travis/zanysoft/laravel-serpapi.svg?style=flat-square)](https://travis-ci.org/zanysoft/laravel-serpapi)\n[![Quality Score](http://img.shields.io/scrutinizer/g/zanysoft/laravel-serpapi/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/zanysoft/laravel-serpapi/)\n[![Total Downloads](https://img.shields.io/packagist/dt/zanysoft/laravel-serpapi.svg?style=flat-square)](https://packagist.org/packages/zanysoft/laravel-serpapi)\n\nThis is where your description should go.\n\n### Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require zanysoft/laravel-serpapi\n```\n\n### Configuration\nYou can publish the config file with:\n```bash\nphp artisan vendor:publish --provider=\"ZanySoft\\LaravelSerpApi\\SerpApiServiceProvider\" --tag=\"serpapi-config\"\n```\n\nThis is the contents of the published config file:\n\n```php\nreturn [\n    'api_key' =\u003e env('SERPAPI_API_KEY'),\n    'search_engine' =\u003e env('SERPAPI_ENGINE', 'google')\n];\n```\nGet \"your api key\" from https://serpapi.com/dashboard\n\n### Usage\n\nThen you can start coding something like:\n```php\nuse ZanySoft\\LaravelSerpApi\\Facades\\SerpApi;\n\n$client = SerpApi::GoogleSearch();\n$query = [\"q\" =\u003e \"coffee\",\"location\"=\u003e\"Austin,Texas\"];\n$response = $client-\u003eget_json($query);\nprint_r($response)\n ```\nAlternatively, you can search:\n- Bing using `SerpApi::BingSearch()`\n- Baidu using `SerpApi::BaiduSearch()`\n- Ebay using `SerpApi::EbaySearch()`\n- Yahoo using `SerpApi::YahooSearch()`\n- Yandex using `SerpApi::YandexSearch()`\n- Walmart using `SerpApi::WalmartSearch()`\n- Youtube using `SerpApi::YoutubeSearch()`\n- HomeDepot using `SerpApi::Search($engine)`\n- Apple App Store using `SerpApi::Search($engine)`\n- Naver using `SerpApi::NaverSearch()`\n\nSee the playground to generate your code.\nhttps://serpapi.com/playground\n\n### Examples\n#### Search API capability\n```php\nuse ZanySoft\\LaravelSerpApi\\Facades\\SerpApi;\n\n$client = SerpApi::GoogleSearch();\n\n$query = [\n  \"q\" =\u003e  \"query\",\n  \"google_domain\" =\u003e  \"Google Domain\", \n  \"location\" =\u003e  \"Location Requested\", \n  \"device\" =\u003e  \"device\",\n  \"hl\" =\u003e  \"Google UI Language\",\n  \"gl\" =\u003e  \"Google Country\",\n  \"safe\" =\u003e  \"Safe Search Flag\",\n  \"num\" =\u003e  \"Number of Results\",\n  \"start\" =\u003e  \"Pagination Offset\",\n  \"serp_api_key\" =\u003e  \"Your SERP API Key\",\n  \"tbm\" =\u003e \"nws|isch|shop\"\n  \"tbs\" =\u003e \"custom to be search criteria\"\n  \"async\" =\u003e true|false # allow async \n];\n\n$html_results = $client-\u003eget_html($query);\n$json_results = $client-\u003eget_json($query);\n```\n\n#### Location API\n\n```php\nuse ZanySoft\\LaravelSerpApi\\Facades\\SerpApi;\n\n$client = SerpApi::GoogleSearch();\n\n$location_list = $client-\u003eget_location('Austin', 3);\nprint_r($location_list);\n```\nit prints the first 3 location matching Austin (Texas, Texas, Rochester)\n```php\n[{:id=\u003e\"585069bdee19ad271e9bc072\",\n  :google_id=\u003e200635,\n  :google_parent_id=\u003e21176,\n  :name=\u003e\"Austin, TX\",\n  :canonical_name=\u003e\"Austin,TX,Texas,United States\",\n  :country_code=\u003e\"US\",\n  :target_type=\u003e\"DMA Region\",\n  :reach=\u003e5560000,\n  :gps=\u003e[-97.7430608, 30.267153],\n  :keys=\u003e[\"austin\", \"tx\", \"texas\", \"united\", \"states\"]},\n  ...]\n```\n\n#### Account API\n```php\nuse ZanySoft\\LaravelSerpApi\\Facades\\SerpApi;\n\n$client = SerpApi::GoogleSearch();\n\n$info = $client-\u003eget_account();\nprint_r($info);\n```\nit prints your account information.\n\n#### Search Google Images\n\n```php\nuse ZanySoft\\LaravelSerpApi\\Facades\\SerpApi;\n\n$client = SerpApi::GoogleSearch();\n$data = $client-\u003eget_json([\n  'q' =\u003e \"Coffee\", \n  'tbm' =\u003e 'isch'\n]);\n\nforeach($data-\u003eimages_results as $image_result) {\n  print_r($image_result-\u003eoriginal);\n}\n```\nthis code prints all the images links\n\n## Conclusion\n\nSerpApi 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:\n\n- isch: Google Images API.\n- nws: Google News API.\n- shop: Google Shopping API.\n- any other Google service should work out of the box.\n- (no tbm parameter): regular Google search.\n  The field tbs allows to customize the search even more.\n\n[The full documentation is available here.](https://serpapi.com/search-api)\n\n### License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanysoft%2Flaravel-serpapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzanysoft%2Flaravel-serpapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanysoft%2Flaravel-serpapi/lists"}