Actor picture

Google Search Scraper

apify/google-search-scraper

Crawls Google Search result pages (SERPs) and extracts a list of organic and paid results, ads, snap packs and more. Supports selection of custom country or language, and extraction of custom attributes.

The following table shows specification of the actor INPUT fields as defined by its input schema. These fields can be entered either manually in the app, or provided in a JSON object when running the actor using the API. Read more in docs.

Search queries or URLs

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.

Optional

Type: string

Country

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.

Optional

Type: string

Options
  • United States: ""
  • Afghanistan: "af"
  • Albania: "al"
  • Algeria: "dz"
  • American Samoa: "as"

Language

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.

Optional

Type: string

Options
  • Default: ""
  • Afrikaans: "af"
  • Albanian: "sq"
  • Amharic: "sm"
  • Arabic: "ar"

UULE location code

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 or read more.

This setting only applies to Search queries, but not to URLs.

Optional

Type: string

Results per page

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.

Optional

Type: integer

minimum: 1

maximum: 100

Max pages per query

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.

Optional

Type: integer

minimum: 1

Custom data function

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.

Optional

Type: string

Max concurrency

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.

Optional

Type: integer

minimum: 1

maximum: 100

Save HTML

If checked, the results will contain the raw HTML of Google Search results pages.

Optional

Type: boolean

Mobile results

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

Optional

Type: boolean