Google News API (Async)

The Google News API endpoint will retrieve news data from a Google news result page and transform it into usable JSON.

Single Query Request

curl -X POST \
	-H "Content-Type: application/json" \
	-d '{
			"apiKey": "API_KEY",
			"query": "QUERY",
			"country_code": "COUNTRY_CODE",
			"tld": "TLD",
			"hl": "LANGUAGE",
			"gl": "GEOLOCATION",
			"start": "STARTING_POSITION",
			"callback": {
				"type": "webhook",
				"url": "YYYYY"
			}
		}' \
"https://async.scraperapi.com/structured/google/news"

Multiple Queries Request

curl -X POST \
	-H "Content-Type: application/json" \
	-d '{
			"apiKey": "API_KEY",
			"queries": ["QUERY1", "QUERY2"],
			"country_code": "COUNTRY_CODE",
			"tld": "TLD",
			"hl": "LANGUAGE",
			"gl": "GEOLOCATION",
			"start": "STARTING_POSITION",
			"callback": {
				"type": "webhook",
				"url": "YYYYY"
			}
		}' \
"https://async.scraperapi.com/structured/google/news"

Supported Parameters

Parameter
Details

API_KEY(required)

Your API Key.

QUERY(required)

Example: Space News

TLD

Country of Google domain to scrape. This is an optional argument and defaults to “com” (google.com). Valid values include: com (google.com) co.uk (google.co.uk) ca (google.ca) de (google.de) es (google.es) fr (google.fr) it (google.it) co.jp (google.co.jp) in (google.in) cn (google.cn) com.sg (google.com.sg) com.mx (google.com.mx) ae (google.ae) com.br (google.com.br) nl (google.nl) com.au (google.com.au) com.tr (google.com.tr) sa (google.sa) se (google.se) pl (google.pl)

COUNTRY_CODE

Valid values are two letter country codes for which we offer Geo Targeting (e.g. “au”, “es”, “it”, etc.). Where a Google domain needs to be scraped from another country (e.g. scraping google.com from Canada), both TLD and COUNTRY_CODE parameters must be specified.

OUTPUT_FORMAT

For structured data methods we offer CSV and JSON output. JSON is default if parameter is not added. Options:

  • csv

  • json (default)

Google parameters supported by this endpoint

Google Parameters
Details

UULE

Set a region for a search. For example: w+CAIQICINUGFyaXMsIEZyYW5jZQ. You can find an online UULE generator herearrow-up-right.

HL

Host Language. For example: DE

GL

Boosts matches whose country of origin matches the parameter value. For example: DE

TBS

Limits results to a specific time range. For example: tbs=d returns results from the past day. Possible values: tbs=h - Hour

tbs=d - Day

tbs=w - Week

tbs=m - Month

tbs=y - Year

IE

Character encoding how the engine interpret the query string. For example: UTF8

OE

Character encoding used for the results. For example: UTF8

START

Set the starting offset in the result list. When start=10 set the first element in the result list will be the 10th search result. (meaning it starts with page 2 of results if the "num" is 10)

Sample Response

Single Query Request

Multiple Queries Request

After the job(s) finish, you will find the result under the response key in the response JSON object. The structure is the same as in the corresponding SYNC data endpoint.

Last updated