Google Search Results API

Google Search Results API

Scrapes Google Search engine result pages (SERPs) and extracts results in JSON format.
Free Plan $0.00 Monthly Subscribe
100 Requests / Monthly
Free for Lifetime
No Credit Card Required
MOST POPULAR
Starter Plan $19.99 Monthly Subscribe
6,000 Requests / Monthly
Standard Support
Fast and reliable
Ability to set country IP
Ability to emulate mobile browsers
Ability to scrape Shopping results
Ability to scrape ads
Ability to scrape safe results only.
Pro Plan $149.99 Monthly Subscribe
60,000 Requests / Monthly
Standard Support
Fast and reliable
Ability to set country IP
Ability to emulate mobile browsers
Ability to scrape Shopping results
Ability to scrape ads
Ability to scrape safe results only.
Custom Plan Volume Monthly Contact Us
Any requests volume you need
Fast and reliable
Ability to set country IP
Ability to emulate mobile browsers
Ability to scrape Shopping results
Ability to scrape ads
Ability to scrape safe results only.
Google Search Results API

What is Google Search Results API?

Google Search Results API, as the name implies, scrapes Google Search engine result pages (SERPs) and obtains a bunchful of organic and paid results along with ads, related links and more. It provides you multiple aspects of experience with the selection of custom country and/or language, and more, it’s capable of retrieving shopping results and mobile pages.

It extracts the followings when you perform a request:

  • Organic results
  • Ads
  • Related queries
  • Shopping results

Worth to mention, though, this API doesn’t scrape special types of search results for such as Google Images and Google News.

What is Input Parameters?

Specifying the location

You can make a geolocation aware search by specifying either the "uule" region parameter or the country parameter.

If the country parameter is set, the scraper will grab a random residential IP address from the country and make the actual call using it. We support more than 170 countries so far (yay!), so it is probably the most convenient way of making location aware searches.

As we suggested, It is also possible to set the uule parameter. To learn more about uule, just check here.

Specifying the browser language

Specifying the browser language is another way of performing the search. It is as simple as setting the "lang" parameter. It should be a 2-character language code.

Specifying the Google Domain

You can perform your search on any Google domains you’d like. Just pass the domain parameter with an actual value such as google.co.uk or google.ee and we'll use this google domain for search. It is best to use this parameter in combination with the country and lang parameters to mimic an actual user behavior.

Scraping Shopping Results

Google Shopping is a controversial but trending Google Service as it satisfies the beginner online shoppers. In order to fetch the Google Shopping results, just set the "shopping" parameter to true and there you go!

Emulating the mobile browser

It’s a piece of cake to set the mobile parameter to “true” and we'll use a mobile screen to fetch the results for you.

Fetching similar results

If you set the "show_similar" parameter to true, we'll also scrape the similar results from the search results.

Safe Results

As the saying goes “safety first”, taking care of minors’ safety is on the top. If you wish to scrape the child-safe results, just set the "safe_search" parameter to true and we'll take this request into account.

Pagination

Pagination is as simple as setting the "start" parameter to any integer. We'll scrape the results starting from that value. If your first page has 10 results, than setting this parameter to 11 will grab the results from the second page. So simple.

What is use cases for Google Search API?

Let’s face it: we ask Google more than anyone else! It's the major key of our daily internet experience. Every business cares about how they rank on Google and would try anything to get on top of another one. Unfortunately, there isn’t any public API Google Search provides -for now- so the ultimate solution to oversee the search results and ranking is to use a web scraping tool.

Typical use cases for Google Search Results API include:

  • Search engine optimization (SEO) is the first thing that comes to mind. It gives you the insight you need for your website’s performance on Google Search results and ranking.
  • You can track how your competitors' are doing by checking both organic & paid results.
  • You can check the ads for certain set of keywords and see what’s the trend
  • You can scrape and collect reviews about a specific kind of products for further market research and trends

How to try Google Search API?

Just subscribe to this API for free and start experimenting. There is a free tier available and no credit cards are needed to try

Sample code

Running a simple query is as simple as below. The only required parameter is "q", the rest is optional.


curl --location --request \
GET 'https://api.apilayer.com/google_search?q=greenland' \
--header 'apikey: YOUR API KEY'

The results are pretty self explanatory. Just check them yourself.


{
    "general": {
        "language": "en",
        "location": "United States",
        "mobile": false,
        "basic_view": false,
        "search_type": "text"
    },
    "organic": [
        {
            "rank": 1,
            "link": "#",
            "display_link": "en.wikipedia.org › wiki › Greenland",
            "title": "Greenland - Wikipedia",
            "description": "Greenland is the world's largest island, located between the Arctic and Atlantic oceans, east of the Canadian Arctic Archipelago. It is an autonomous territory ..."
        },
        {
            "rank": 2,
            "link": "#",
            "display_link": "visitgreenland.com",
            "title": "Greenland - The Official Tourism Site. Find your adventure ...",
            "description": "All about Greenland. Find travel offers and ideas for your next adventure. Get inspired and plan your trip to Greenland here."
        },
        {
            "rank": 3,
            "link": "#",
            "display_link": "www.britannica.com › ... › Islands & Archipelagos",
            "title": "Greenland | History, Geography, & Culture | Britannica",
            "description": "Greenland, the world's largest island, lying in the North Atlantic Ocean. Greenland is noted for its vast tundra and immense glaciers. Map of Greenland highlighting ..."
        },
        {
            "rank": 4,
            "link": "#",
            "display_link": "www.imdb.com › title",
            "title": "Greenland (2020) - IMDb",
            "description": "Directed by Ric Roman Waugh. With Gerard Butler, Morena Baccarin, Roger Dale Floyd, Scott Glenn. A family struggles for survival in the face of a cataclysmic ...",
            "extensions": [
                {
                    "text": "Rating: 6.5/10",
                    "rating": true
                },
                {
                    "text": "2,062 votes"
                }
            ]
        },
        {
            "rank": 5,
            "link": "#",
            "display_link": "nsidc.org › greenland-today",
            "title": "Greenland Ice Sheet Today | Surface Melt Data presented by ...",
            "description": "Melting through the peak of Greenland's summer melt season has been well above the 1981 to 2010 average, but below the levels of many ...",
            "extensions": [
                {
                    "text": "Aug 12, 2020",
                    "inline": true
                }
            ]
        },
        {
            "rank": 6,
            "link": "#",
            "display_link": "www.bbc.com › news › world-europe-18249474",
            "title": "Greenland profile - BBC News - BBC.com",
            "description": "Greenland is the world's largest island and an autonomous Danish dependent territory with limited self-government and its own parliament.",
            "extensions": [
                {
                    "text": "Jul 23, 2018",
                    "inline": true
                }
            ]
        },
        {
            "rank": 7,
            "link": "#",
            "display_link": "www.bbc.com › news › science-environment-54127279",
            "title": "Climate change: Warmth shatters section of Greenland ice ...",
            "description": "A big chunk of ice has broken away from the Arctic's largest remaining ice shelf - 79N, or Nioghalvfjerdsfjorden - in north-east Greenland.",
            "extensions": [
                {
                    "text": "Sep 14, 2020",
                    "inline": true
                }
            ]
        },
        {
            "rank": 8,
            "link": "#",
            "display_link": "www.cia.gov › library › publications › the-world-factbook › geos",
            "title": "North America :: Greenland — The World Factbook - Central ...",
            "description": "View Greenland Photo Gallery. ONE-PAGE SUMMARY. View 25 photos of. GREENLAND. TRAVEL FACTS. The World Factbook Country/Location Photo Gallery ..."
        }
    ],
    "knowledge": {
        "name": "Greenland",
        "description": "Greenland is the world's largest island, located between the Arctic and Atlantic oceans, east of the Canadian Arctic Archipelago. It is an autonomous territory within the Kingdom of Denmark.",
        "description_source": "Wikipedia",
        "description_link": "#"
    },
    "related": [
        {
            "link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=greenland+population&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQ1QIoAHoECCcQAQ",
            "text": "greenland population"
        },
        {
            "link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=greenland+people&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQ1QIoAXoECCcQAg",
            "text": "greenland people"
        },
        {
            "link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=greenland+map&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQ1QIoAnoECCcQAw",
            "text": "greenland map"
        },
        {
            "link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=greenland+country&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQ1QIoA3oECCcQBA",
            "text": "greenland country"
        },
        {
            "link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=greenland+trailer&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQ1QIoBHoECCcQBQ",
            "text": "greenland trailer"
        },
        {
            "link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=greenland+capital&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQ1QIoBXoECCcQBg",
            "text": "greenland capital"
        },
        {
            "link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=nuuk,+greenland&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQ1QIoBnoECCcQBw",
            "text": "nuuk, greenland"
        },
        {
            "link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=greenland+tourism&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQ1QIoB3oECCcQCA",
            "text": "greenland tourism"
        }
    ],
    "people_also_ask": [
        {
            "question": "Is Greenland a safe country?",
            "question_link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=Is+Greenland+a+safe+country%3F&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQzmd6BAgaEAw",
            "answer_source": "Is Greenland Safe? 8 Things I Wish I Knew Before I Went",
            "answer_link": "#",
            "answer_display_link": "www.worldnomads.com \› how-to-stay-safe-while-exploring-greenlandwww.worldnomads.com \› how-to-stay-safe-while-exploring-greenland",
            "answer_html": "
Greenland is not a place you have to worry about crime. According to the statistical website, Numbeo, Greenland rates as low for crime and high for safety.Oct 24, 2019
" }, { "question": "Can people go to Greenland?", "question_link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=Can+people+go+to+Greenland%3F&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQzmd6BAgaEBc", "answer_source": "How to Visit Greenland and What To Do While You're on the Island", "answer_link": "#", "answer_display_link": "www.eaglecreek.com \› trending-2018-how-and-why-visit-greenlandwww.eaglecreek.com \› trending-2018-how-and-why-visit-greenland", "answer_html": "
No flights go directly to Greenland from North America, so the simplest option for tourists from this side of the globe involves going through Reykjavik, Iceland. From there, you can fly to several cities on the island, including Nuuk\—Greenland's capital and largest city with around 15,000 residents.Dec 11, 2017
" }, { "question": "What country owns Greenland?", "question_link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=What+country+owns+Greenland%3F&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQzmd6BAgaECM", "answer_source": "Greenland profile - BBC News", "answer_link": "#", "answer_display_link": "www.bbc.com \› news \› world-europe-18249474www.bbc.com \› news \› world-europe-18249474", "answer_html": "
Denmark
Greenland is the world's largest island and an autonomous Danish dependent territory with limited self-government and its own parliament. Denmark contributes two thirds of Greenland's budget revenue, the rest coming mainly from fishing.Jul 23, 2018
" }, { "question": "What is Greenland best known for?", "question_link": "https://www.google.com/search?hl=en&adtest=on&gl=us&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q=What+is+Greenland+best+known+for%3F&sa=X&ved=2ahUKEwiI3Mrb6_rrAhUQPK0KHZEQCXMQzmd6BAgaEC0", "answer_source": "Greenland | History, Geography, & Culture | Britannica", "answer_link": "#", "answer_display_link": "www.britannica.com \› place \› Greenlandwww.britannica.com \› place \› Greenland", "answer_html": "
Greenland, the world's largest island, lying in the North Atlantic Ocean. Greenland is noted for its vast tundra and immense glaciers.
" } ] }

Related Articles

Google Search Results API Reference

This API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Just Getting Started?

Check out our development quickstart guide.

Authentication

Google Search Results API uses API keys to authenticate requests. You can view and manage your API keys in the Accounts page.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

All requests made to the API must hold a custom HTTP header named "apikey". Implementation differs with each programming language. Below are some samples.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Endpoints

Searches Google

Parameters

q (required)

Query string

Location: Query, Data Type: string

country (optional)

country the search will be made from (2 character alpha)

Location: Query, Data Type: string

domain (optional)

What search engine domain will be used for search

Location: Query, Data Type: string

lang (optional)

2 character language parameter

Location: Query, Data Type: string

mobile (optional)

If set to true the search will be made from a mobile screen

Location: Query, Data Type: string

safe_search (optional)

If set tı true, only child-safe results will return

Location: Query, Data Type: string

shopping (optional)

If set to true the search will be made as shopping

Location: Query, Data Type: string

show_similar (optional)

If set to true similar

Location: Query, Data Type: string

start (optional)

Search result to start

Location: Query, Data Type: int

uule (optional)

Google way of emulating the geo location request

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Rate Limiting

Each subscription has its own rate limit. When you become a member, you start by choosing a rate limit that suits your usage needs. Do not worry; You can upgrade or downgrade your plan at any time. For this reason, instead of starting with a larger plan that you do not need, we can offer you to upgrade your plan after you start with "free" or "gold plan" options and start using the API.

When you reach a rate limit (both daily and monthly), the service will stop responding and returning the HTTP 429 response status code (Too many requests) for each request with the following JSON string body text.

{
"message":"You have exceeded your daily\/monthly API rate limit. Please review and upgrade your subscription plan at https:\/\/apilayer.com\/subscriptions to continue."
}

A reminder email will be sent to you when your API usage reaches both 80% and 90%, so that you can take immediate actions such as upgrading your plan in order to prevent your application using the API from being interrupted.

You can also programmatically check your rate limit yourself. As a result of each request made to the APILayer, the following 4 fields provide you with all the necessary information within the HTTP Headers.

x-ratelimit-limit-month: Request limit per month
x-ratelimit-remaining-month: Request limit remaining this month
x-ratelimit-limit-day: Request limit per day
x-ratelimit-remaining-day: Request limit remaining today

You can contact our support unit if you need any assistance with your application regarding to handle the returned result by looking at the header information.

Error Codes

APILayer uses standard HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate a clientside error, which means that failed given the information provided (e.g., a missing parameter, unauthorized access etc.). Codes in the 5xx range indicate an error with APILayer's servers (normally this should'nt happen at all).

If the response code is not 200, it means the operation failed somehow and you may need to take an action accordingly. You can check the response (which will be in JSON format) for a field called 'message' that briefly explains the error reported.

Status Code Explanation
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized No valid API key provided.
404 - Not Found The requested resource doesn't exist.
429 - Too many requests API request limit exceeded. See section Rate Limiting for more info.
5xx - Server Error We have failed to process your request. (You can contact us anytime)

You can always contact for support and ask for more assistance. We'll be glad to assist you with building your product.