https://github.com/webbamboo/seoresearch-serp-sdk
Google SERP results in PHP via Seoresearch API
https://github.com/webbamboo/seoresearch-serp-sdk
Last synced: about 1 year ago
JSON representation
Google SERP results in PHP via Seoresearch API
- Host: GitHub
- URL: https://github.com/webbamboo/seoresearch-serp-sdk
- Owner: WebBamboo
- Created: 2020-04-06T09:02:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-10T06:53:31.000Z (about 6 years ago)
- Last Synced: 2025-01-29T08:35:27.230Z (over 1 year ago)
- Language: PHP
- Homepage: https://seoresearch.net
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google SERP Results in PHP
SEOResearch SERP API enables you to scrape Google search results straight from your code. It requires a [free registration](https://seoresearch.net/google-search-api/) at Seoresearch.net
# Quick start
For composer ([Packagist](https://packagist.org/packages/webbamboo/seoresearch-serp-sdk)).
```bash
composer require webbamboo/seoresearch-serp-sdk
```
Load the dependency in your script:
```php
getHistory());
```
## Create SERP request
```php
keyword = 'serp api google';
$serp->endpoint = 'http://your-webhook-url.com/webhook.php';
$serp->sendToApi($sdk);
var_dump($serp);
```
## Get SERP results
```php
fromId($sdk, 'YOUR_SERP_ID');
var_dump($serp);
```
## Webhook
```php
webhook($_POST, true));
```
## Anatomy of a SERP object
In order to populate a Serp object you can set the following properties: location, endpoint, mobile, keyword. You can see more about how that works in the [Create SERP request](#Create_SERP_request_49) section.
Methods:
- fromId(Sdk $sdk, $id) - Queries the API and hydrates the Serp object with the data. Takes an SDK object and Serp ID as a parameter.
- fromData($apiData) - Hydrates a Serp object from API response string
- sendToApi(Sdk $sdk) - Creates the actual Serp object in the API and updates the Serp object with the ID of the created resource