Actor picture

Google Trends Scraper

emastra/google-trends-scraper

Google Trends API to scrape data from Google Trends. Extract data for multiple search terms listed in a Google Sheet, define time ranges to get results at a higher frequency, select categories, and specify geographical locations. Download your data as HTML, JSON, CSV, Excel, XML, and more.

No credit card required

Author's avatarEmiliano Mastragostino
  • Modified
  • Users1,448
  • Runs71,471
Actor picture
Google Trends Scraper

Search terms

searchTerms

Optional

array

(Required if 'spreadsheetId' is not provided) List of search terms to be scraped.

Time range

timeRange

Optional

string

Choose a predefined search's time range (defaults to 'Past 12 months')

Options:

"now 1-H", "now 4-H", "now 1-d", "now 7-d", "today 1-m", "today 3-m", "today 5-y", "all"

Geo area

geo

Optional

string

Get results from a specific geo area (defaults to 'Worldwide')

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", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "CV", "KH", "CM", "CA", "KY", "CF", "TD", "CL", "CN", "CX", "Keeling Islands ", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "Malvinas ", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "Vatican City State ", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "the Democratic People's Republic of ", "the Republic of ", "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", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "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", "BL", "SH", "KN", "LC", "French part ", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "Dutch part ", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "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"

Google sheet ID (To get input data from Google sheet)

spreadsheetId

Optional

string

(Optional) Id of the google sheet from where search terms will be loaded. Spreadsheet must have only one column. Row 1 is considered the title of the column so it will not be loaded as a search term. Check the actor documentation for more info.

Is the Google sheet public

isPublic

Optional

boolean

If checked you can import a public spreadsheet without need for authorization. For importing private sheets, please read about authorization in the actor documentation.

Category of trends

category

Optional

string

Choose a category to filter the search for (defaults to 'All categories')

Options:

"3", "47", "44", "22", "12", "5", "7", "71", "8", "45", "65", "11", "13", "958", "19", "16", "299", "14", "66", "29", "533", "174", "18", "20", "67"

Max items

maxItems

Optional

integer

Limit of product items to be scraped. Zero value means no limit.

Custom time range

customTimeRange

Optional

string

Provide custom time range. If present, it takes precedence over regular timeRange. Format is: `YYYY-MM-DD YYYY-MM-DD`. See examples in the documentation.

Extend output function

extendOutputFunction

Optional

string

A function which result will get merged with the default result. It must return an object.

Proxy configuration

proxyConfiguration

Required

object

The best option is usually Automatic proxy, but you can also use your own proxies or no proxy. It defaults to useApifyProxy. Country defaults to 'US'.

Output as ISO Date

outputAsISODate

Optional

boolean

Outputs date column as an ISO date time string

Max concurrency

maxConcurrency

Optional

integer

How many pages will be opened in parallel if enough CPU is available.

Page load timeout

pageLoadTimeoutSecs

Optional

integer

How long it will wait for page loading before it abandons the loading and tries again.