Actor picture

Google Search Results Scraper

apify/google-search-scraper

Unofficial API to enable you to scrape Google Search Engine Results Pages (SERPs). Export organic and paid results, ads, queries, people also ask, prices, reviews. Supports custom country or language and extraction of custom attributes. Download data as HTML table, JSON, CSV, Excel, XML.

Author's avatarApify Technologies
  • Modified
  • Used by8,997 users
  • Used2,064,635 times
Actor picture
Google Search Results Scraper

Search queries or URLs

queries

Optional

string

Google Search queries (e.g. food in NYC) and/or full URLs (e.g. https://www.google.com/search?q=food+NYC). Enter one item per line.

Country

countryCode

Optional

string

Country determines the IP address of the proxy used for the query and the Google Search domain (e.g. google.es for Spain). The values must be lower-cased ISO 3166 country codes supported by Google. By default, the actor uses United States (google.com). This setting only applies to Search queries, but not to URLs.

Options:

"af", "al", "dz", "as", "ad", "ao", "ai", "aq", "ag", "ar", "am", "aw", "au", "at", "az", "bs", "bh", "bd", "bb", "by", "be", "bz", "bj", "bm", "bt", "bo", "ba", "bw", "bv", "br", "io", "bn", "bg", "bf", "bi", "kh", "cm", "ca", "cv", "ky", "cf", "td", "cl", "cn", "cx", "cc", "co", "km", "cg", "cd", "ck", "cr", "ci", "hr", "cu", "cy", "cz", "dk", "dj", "dm", "do", "ec", "eg", "sv", "gq", "er", "ee", "et", "fk", "fo", "fj", "fi", "fr", "gf", "pf", "tf", "ga", "gm", "ge", "de", "gh", "gi", "gr", "gl", "gd", "gp", "gu", "gt", "gn", "gw", "gy", "ht", "hm", "va", "hn", "hk", "hu", "is", "in", "id", "ir", "iq", "ie", "il", "it", "jm", "jp", "jo", "kz", "ke", "ki", "kp", "kr", "kw", "kg", "la", "lv", "lb", "ls", "lr", "ly", "li", "lt", "lu", "mo", "mk", "mg", "mw", "my", "mv", "ml", "mt", "mh", "mq", "mr", "mu", "yt", "mx", "fm", "md", "mc", "mn", "ms", "ma", "mz", "mm", "na", "nr", "np", "nl", "an", "nc", "nz", "ni", "ne", "ng", "nu", "nf", "mp", "no", "om", "pk", "pw", "ps", "pa", "pg", "py", "pe", "ph", "pn", "pl", "pt", "pr", "qa", "re", "ro", "ru", "rw", "sh", "kn", "lc", "pm", "vc", "ws", "sm", "st", "sa", "sn", "cs", "sc", "sl", "sg", "sk", "si", "sb", "so", "za", "gs", "es", "lk", "sd", "sr", "sj", "sz", "se", "ch", "sy", "tw", "tj", "tz", "th", "tl", "tg", "tk", "to", "tt", "tn", "tr", "tm", "tc", "tv", "ug", "ua", "ae", "gb", "us", "um", "uy", "uz", "vu", "ve", "vn", "vg", "vi", "wf", "eh", "ye", "zm", "zw"

Language

languageCode

Optional

string

Language for the search results, which is passed to Google Search as the hl URL query parameter. Only set this if you want to use a non-default language for the selected country. The values must be lower-cased ISO 639 language codes supported by Google. This setting only applies to Search queries, but not to URLs.

Options:

"af", "sq", "sm", "ar", "az", "eu", "be", "bn", "bh", "bs", "bg", "ca", "zh-CN", "zh-TW", "hr", "cs", "da", "nl", "en", "eo", "et", "fo", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "iw", "hi", "hu", "is", "id", "ia", "ga", "it", "ja", "jw", "kn", "ko", "la", "lv", "lt", "mk", "ms", "ml", "mt", "mr", "ne", "no", "nn", "oc", "fa", "pl", "pt-BR", "pt-PT", "pa", "ro", "ru", "gd", "sr", "si", "sk", "sl", "es", "su", "sw", "sv", "tl", "ta", "te", "th", "ti", "tr", "uk", "ur", "uz", "vi", "cy", "xh", "zu"

UULE location code

locationUule

Optional

string

The code for geolocation of search results. It's passed to Google Search as the uule URL query parameter. You can use the UULE code generator. Learn more about emulating local search. This setting only applies to Search queries, but not to URLs.

Results per page

resultsPerPage

Optional

integer

Number of search results per page. By default, Google Search returns 10 results. The allowed values are: 10, 20, 30, 40, 50 and 100. This setting only applies to Search queries, but not to URLs.

Max pages per query

maxPagesPerQuery

Optional

integer

The maximum number of search result pages crawled for each search query or URL. Note that a value greater than one might significantly slow down the actor.

Custom data function

customDataFunction

Optional

string

Custom JavaScript function to extract additional attributes from the HTML of the result pages. The function accepts the same parameters as the handlePageFunction of the CheerioCrawler in Apify SDK. The return value of the function is saved to the results as the customData property.

Max concurrency

maxConcurrency

Optional

integer

The maximum number of search results pages the crawler will load in parallel. A higher number means you will get your results faster, but also it will burn through your available proxies quicker.

Save HTML to dataset

saveHtml

Optional

boolean

If checked, the HTML of Google Search results pages will be stored to the default dataset, under the html property. This is useful if you need to process the HTML, but it makes the dataset large and reduces performance.

Save HTML to key-value store

saveHtmlToKeyValueStore

Optional

boolean

If checked, the HTML of the Google Search results pages will be stored to the default key-value store and links to the files stored to the dataset under the htmlSnapshotUrl property. This is useful for debugging, since you can easily view the the pages in browser, but use of this feature has some performance penalty.

Mobile results

mobileResults

Optional

boolean

If checked, the crawler will return results for the mobile version of the Google Search. By default, desktop results are returned.

Include unfiltered results

includeUnfilteredResults

Optional

boolean

If checked, the lower quality results that Google normally filters out will be included. Usually it is few hundred extra results.