NAV
shell python php

Introduction

SERPSBOT offers a robust API to get Google SERPs results as JSON data. We offer a highly-reliable API service at an affordable price. This documentation helps you get started using our API service.

Get SERP Results

Get SERP results:

import requests

# Your API key
apikey = 'your-api-key-here'
headers = {
  'Authorization': 'Bearer {}'.format(apikey)
}

payload = {
  'q': 'covid19',
  'page': 2,
  'hl': 'en-US',
  'gl': 'us'
}

res = requests.get('https://serpsbot.com/api/v1/google-serps/', headers=headers, params=payload)

# JSON data
res.json()
# In a terminal, you can use CURL to get SERP results
curl -X GET -H "Authorization: Bearer your-api-key-here" "https://serpsbot.com/api/v1/google-serps/?q=covid19&page=2&hl=en-US&gl=us"
use Guzzle\Client;
$options = [
  'headers' => [
    'Authorization' => 'Bearer your-api-key-here'
  ],
  'params' => [
    'q' => 'covid19',
    'page' => 2,
    'hl' => 'en-US',
    'gl' => 'us'
  ]
];
$client = new Client();
$res = $client->get("https://serpsbot.com/api/v1/google-serps/", $options);

// JSON data
$json = json_decode($res->getBody()->getContents(), true);

Example Response:

{
    "data": {
        "meta": {
            "page": 2,
            "results": 17,
            "query": "covid19",
            "gl": "us",
            "duration": null,
            "hl": "en-US",
            "time_taken": 1.7270863056182861,
            "credits_left": 707705
        },
        "results": {
            "organic": [
                {
                    "url": "https://covid19.ca.gov/",
                    "title": "California Coronavirus - CA.gov",
                    "rank": 1,
                    "snippet": "Official website for California Coronavirus (COVID-19) Response daily updates and resources. Stay home - save lives. Find information and services to help you ...",
                    "snippet_html": "<span class=\"st\">\n Official website for California Coronavirus (\n <em>\n  COVID-19\n </em>\n ) Response daily updates and resources. Stay home - save lives. Find information and services to help you\n <wbr/>\n ...\n</span>\n"
                },
                {
                    "url": "https://www.cdc.gov/coronavirus/2019-ncov/index.html",
                    "title": "Coronavirus Disease 2019 (COVID-19) | CDC",
                    "rank": 2,
                    "snippet": "Coronavirus (COVID-19) Home Page.",
                    "snippet_html": "<span class=\"st\">\n Coronavirus (\n <em>\n  COVID-19\n </em>\n ) Home Page.\n</span>\n"
                },
                {
                    "url": "https://covid19.healthdata.org/",
                    "title": "COVID-19",
                    "rank": 3,
                    "snippet": "135,109COVID-19 deaths. projected by August 4, 2020. 0 20k 40k 60k 80k 100k 120k 140k 160k 180k 200k 220k 240k 260k 280k 300k Total deaths Mar 1 Apr ...",
                    "snippet_html": "<span class=\"st\">\n 135,109\n <em>\n  COVID-19\n </em>\n deaths. projected by August 4, 2020. 0 20k 40k 60k 80k 100k 120k 140k 160k 180k 200k 220k 240k 260k 280k 300k Total deaths Mar 1 Apr ...\n</span>\n"
                },
                {
                    "url": "https://www.who.int/emergencies/diseases/novel-coronavirus-2019",
                    "title": "Coronavirus disease 2019 - World Health Organization",
                    "rank": 4,
                    "snippet": "Information on COVID-19, the infectious disease caused by the most recently discovered coronavirus.",
                    "snippet_html": "<span class=\"st\">\n Information on\n <em>\n  COVID-19\n </em>\n , the infectious disease caused by the most recently discovered coronavirus.\n</span>"
                },
                {
                    "url": "https://www.who.int/emergencies/diseases/novel-coronavirus-2019/situation-reports",
                    "title": "Coronavirus Disease (COVID-19) Situation Reports",
                    "rank": 5,
                    "snippet": "The daily Situation Report provides the current COVID-19 epidemiological situation and presents official case and death counts and transmission classifications ...",
                    "snippet_html": "<span class=\"st\">\n The daily Situation Report provides the current\n <em>\n  COVID-19\n </em>\n epidemiological situation and presents official case and death counts and transmission classifications ...\n</span>"
                },
                {
                    "url": "https://www.theatlantic.com/science/archive/2020/06/how-negative-covid-19-test-can-mislead/613246/",
                    "title": "What a Negative COVID-19 Test Really Means - The Atlantic",
                    "rank": 6,
                    "snippet": "1 day ago - Understanding false negatives from COVID-19 tests is especially important because people who do not yet know that they're sick play a major ...",
                    "snippet_html": "<span class=\"st\">\n <span class=\"f\">\n  1 day ago -\n </span>\n Understanding false negatives from\n <em>\n  COVID-19\n </em>\n tests is especially important because people who do not yet know that they're sick play a major ...\n</span>"
                },
                {
                    "url": "https://www.nih.gov/coronavirus",
                    "title": "Coronavirus (COVID-19) | National Institutes of Health (NIH)",
                    "rank": 7,
                    "snippet": "Resources and news releases from the National Institutes of Health regarding the coronavirus (COVID-19).",
                    "snippet_html": "<span class=\"st\">\n Resources and news releases from the National Institutes of Health regarding the coronavirus (\n <em>\n  COVID-19\n </em>\n ).\n</span>"
                },
                {
                    "url": "https://www.alabamapublichealth.gov/covid19/",
                    "title": "Coronavirus Disease 2019 (COVID-19) | Alabama Department ...",
                    "rank": 8,
                    "snippet": "3 days ago - COVID-19, the infectious disease caused by SARS-CoV-2, is now a pandemic affecting many countries globally. Patients with confirmed COVID- ...",
                    "snippet_html": "<span class=\"st\">\n <span class=\"f\">\n  3 days ago -\n </span>\n <em>\n  COVID-19\n </em>\n , the infectious disease caused by SARS-CoV-2, is now a pandemic affecting many countries globally. Patients with confirmed\n <em>\n  COVID-\n </em>\n ...\n</span>"
                },
                {
                    "url": "https://www.scdhec.gov/infectious-diseases/viruses/coronavirus-disease-2019-covid-19",
                    "title": "Coronavirus Disease 2019 (COVID-19) | SCDHEC",
                    "rank": 9,
                    "snippet": "DHEC continues to work with federal, state and local partners as it investigates COVID-19 cases in South ...",
                    "snippet_html": "<span class=\"st\">\n DHEC continues to work with federal, state and local partners as it investigates\n <em>\n  COVID-19\n </em>\n cases in South ...\n</span>\n"
                },
                {
                    "url": "https://www.sciencemag.org/news/2020/05/why-do-some-covid-19-patients-infect-many-others-whereas-most-don-t-spread-virus-all",
                    "title": "Why do some COVID-19 patients infect many others, whereas ...",
                    "rank": 10,
                    "snippet": "May 19, 2020 - Science 's COVID-19 reporting is supported by the Pulitzer Center. When 61 people met for a choir practice in a church in Mount Vernon, ...",
                    "snippet_html": "<span class=\"st\">\n <span class=\"f\">\n  May 19, 2020 -\n </span>\n Science 's\n <em>\n  COVID-19\n </em>\n reporting is supported by the Pulitzer Center. When 61 people met for a choir practice in a church in Mount Vernon, ...\n</span>"
                }
            ]
        }
    }
}

To get SERP results, you need to first get your API key from here and then perform a GET request to our API endpoint https://serpsbot.com/api/v1/google-serps/

Request Headers

Header Value
Authorization Bearer your-api-key-here

Request Parameters

Param Type Required Description
q string yes Search query parameter. All Google search filters like site: and others are supported.
page integer no Number of SERP page to get based on 10 results per page. Defaults to 1 (i.e. first page).
hl string no Language to get search results for. Defaults to en-US (i.e. English USA).
gl string no Country code to get search results for a particular country. Defaults to us.
autocorrect integer no Should Google autocorrect your typos? If no, set this to 0. Defaults to 1.
duration string no Duration to get results updated during the specified time period. Expected values are d (for the last 24 hours), w (for the last 7 days), m (for the last 1 month), mn (for the last n months), and y (for the last 1 year).

Get Account Details

You can perform a GET request at our API endpoint https://serpsbot.com/api/v1/account/ to get details for your account. The server will return your email address, remaining credits, and a count of your API calls as a JSON response.

Request Headers

Header Value
Authorization Bearer your-api-key-here

Get account details:

import requests
headers = {
    "Authorization": "Bearer your-api-key-here"
}
res = requests.get("https://serpsbot.com/api/v1/account/", headers=headers)

# JSON data
res.json()
curl -H "Authorization: Bearer your-api-key-here" "https://serpsbot.com/api/v1/account/"
use Guzzle\Client;
$options = [
    "headers" => [
        "Authorization" => "Bearer your-api-key-here"
    ]
];
$client = new Client();
$res = $client->get("https://serpsbot.com/api/v1/account/", $options);

# JSON data
$json = json_decode($res->getBody()->getContents(), true);

Example Response:

{
    "account": {
        "email": "user@example.com",
        "credits": 123456789,
        "stats": 123456789
    }
}

Errors

Sometieme our API may return certain errors. Please refer to below table in order to understand the error based on the returned status code:

Error Code Meaning
400 Bad Request -- Your request is invalid.
402 Payment Required -- Your API credits balance is exhausted.
403 Your API key seems to be invalid.
405 The request method you are trying isn't supported on this endpoint.
422 A validation error occured for some of your query params or form data.
429 A rare error that tells you that you are making API calls too quickly.
500 Our fault! Something unexpected happened at our hardware end.
503 Our services are unavailable (maybe due to an ongoing maintenance).