Core APIs
...
Google
Core Requests

News

4min
google news parameters get get /search?search type=news the google news parameters are applicable when making a request with search type=news to retrieve news results for a given search term the search term is specified in the q parameter and the optional location parameter can be used to geo locate the news request (locations can be retrieved via the locations api https //docs trajectdata com/valueserp/locations api/overview ) you can use the time period request parameter to refine your news search to specific time periods if you wish to exclude news results where google have modified the original query set exclude if modified=true in your request parameters for example, to request news results for the keyword pizza in the location united states , the request would be http https //api valueserp com/search?api key=demo\&search type=news\&q=pizza\&location=united+statescurl l get https //api valueserp com/search \\ d api key="demo" \\ d q="pizza" \\ d search type="news" \\ d location="united+states"const axios = require('axios'); // set up the request parameters const params = { api key "demo", q "pizza", search type "news", location "united+states" } // make the http get request axios get('https //api valueserp com"/search', { params }) then(response => { // print the json response console log(json stringify(response data, 0, 2)); }) catch(error => { // catch and print the error console log(error); })import requests import json \# set up the request parameters params = { 'api key' 'demo', 'q' 'pizza', 'search type' 'news', 'location' 'united+states' } \# make the http get request api result = requests get('https //api valueserp com/search', params) \# print the json response print(json dumps(api result json()))\<?php \# set up the request parameters $querystring = http build query(\[ 'api key' => 'demo', 'q' => 'pizza', 'search type' => 'news', 'location' => 'united+states' ]); \# make the http get request $ch = curl init(sprintf('%s?%s', 'https //api valueserp com/search', $querystring)); curl setopt($ch, curlopt returntransfer, true); curl setopt($ch, curlopt followlocation, true); \# the following options are required if you're using an outdated openssl version \# more details https //www openssl org/blog/blog/2021/09/13/letsencryptrootcertexpire/ curl setopt($ch, curlopt ssl verifyhost, false); curl setopt($ch, curlopt ssl verifypeer, false); curl setopt($ch, curlopt timeout, 180); $api result = curl exec($ch); curl close($ch); \# print the json response echo $api result; ?> google news parameters the following parameters are available for all requests made when search type=news parameter required description search type required should be set to search type=news q required the keyword you want to use to perform the news search location optional determines the geographic location in which the query is executed you can enter any location as free text, but if you choose one of the value serp built in locations https //docs trajectdata com/valueserp/locations api/overview then the google domain , gl and hl parameters are automatically updated to the domain, country and language that match the built in location (note that this behaviour can be disabled via the location auto parameter) location auto optional if the location field is set to a value serp built in location https //docs trajectdata com/valueserp/locations api/overview from the locations api https //docs trajectdata com/valueserp/locations api/overview , and location auto is set to true (default) then the google domain , gl and hl parameters are automatically updated to the domain, country and language that match the built in location valid values are true (default) to enable this behaviour or false to disable uule optional the google uule parameter use to pass through a custom uule parameter to google value serp automatically generates the uule when you use the location parameter but we allow you to overwrite it directly by specifying a uule directly google domain optional the google domain to use to run the search query view the full list of supported google domain values here https //docs trajectdata com/valueserp/search api/reference/google domains defaults to google com gl optional the gl parameter determines the google country to use for the query view the full list of supported gl values here https //docs trajectdata com/valueserp/search api/reference/google countries defaults to us hl optional the hl parameter determines the google ui language to return results view the full list of supported hl values here https //docs trajectdata com/valueserp/search api/reference/google languages defaults to en lr optional the lr parameter limits the results to websites containing the specified language view the full list of supported lr values here https //docs trajectdata com/valueserp/search api/reference/google lr languages cr optional the cr parameter instructs google to limit the results to websites in the specified country view the full list of supported cr values here https //docs trajectdata com/valueserp/search api/reference/google cr countries time period optional determines the time period of the results shown it can be set to last hour , last day (for the last 24 hours), last week (for the last 7 days), last month , last year or custom when using custom you must also specifiy one or both of the time period min or time period max parameters to define the custom time period time period min optional determines the minimum (i e 'from') time to use when time period is set to custom should be in the form mm/dd/yyyy , i e for 31st december 2018 time period min would be 12/31/2018 time period max optional determines the maximum (i e 'to') time to use when time period is set to custom should be in the form mm/dd/yyyy , i e for 31st december 2018 time period max would be 12/31/2018 nfpr optional determines whether to exclude results from auto corrected queries that were spelt wrong can be set to 1 to exclude auto corrected results, or 0 (default) to include them filter optional determines if the filters for similar results and omitted results are on or off can be set to 1 (default) to enable these filters, or 0 to disable these filters safe optional determines whether safe search is enabled for the results can be set to active to enable safe search, or off to disable safe search page optional determines the page of results to return, defaults to 1 use in combination with the num parameter to implement pagination max page optional use the max page parameter to get multiple pages of results in one request the api will automatically paginate through pages and concatenate the results into one response see the pagination https //docs trajectdata com/valueserp/search api/pagination docs for more information num optional determines the number of results to show per page use in combination with the page parameter to implement pagination the maximum number of news results google return per request is 100 tbs optional sets a specific string to be added to the google tbs parameter in the underlying google query the tbs parameter is normally generated automatically by the api, but it can be set explicitly also sort by optional determines how results are sorted, valid values are relevance or date note that when sort by=date the show duplicates parameter can be used show duplicates optional determines whether duplicates are shown in the news results must be used in conjunction with the sort by parameter where sort by is set to date valid values are true or false defaults to false exclude if modified optional determines whether the news results returned when google modifies the original query set to true to exclude news results when google modifies the original query or false (the default) to include news results when google modifies the original query next steps google news results https //docs trajectdata com/valueserp/search api/results/google/news