Google Trends Autocomplete API
Using Google Trends Autocomple API you can scrape Google Trends Suggestions. Each successful request will cost you 5 API credits.
You have to send a GET request to http://api.scrapingdog.com/google_trends/autocomplete with the below-given parameters.
Google Trends Autocomplete API pricing is available here.
Parameters
Scrapingdog Parameters
Parameter
Description
api_key
required
Your personal API key. Available on your dashboard. Type: String
Search Query
Parameter
Description
query
This is a Google Search Query. Example1 - query=pizza
Type: String
Localization
Parameter
Description
language
Language of the results. Possible Values - en, es, fr, de, etc.
Default Value - en
Type - String
API Example
curl "https://api.scrapingdog.com/google_trends/autocomplete/?api_key=5eaa61a6e562fc52fe763tr516e4653&query=football"import requests
api_key = "5eaa61a6e562fc52fe763tr516e4653"
url = "https://api.scrapingdog.com/google_trends/autocomplete"
params = {
"api_key": api_key,
"query": "football"
}
response = requests.get(url, params=params)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Request failed with status code: {response.status_code}")
const axios = require('axios');
const api_key = '5eaa61a6e562fc52fe763tr516e4653';
const url = 'https://api.scrapingdog.com/google_trends/autocomplete';
const params = {
api_key: api_key,
query: 'football'
};
axios
.get(url, { params: params })
.then(function (response) {
if (response.status === 200) {
const data = response.data;
console.log(data)
} else {
console.log('Request failed with status code: ' + response.status);
}
})
.catch(function (error) {
console.error('Error making the request: ' + error.message);
});
Response
{
"suggestions": [
{
"mid": "/m/02vx4",
"title": "Football",
"type": "Sports",
"link": "https://trends.google.com/trends/explore?q=football"
},
{
"mid": "/m/036bzt",
"title": "Football at the Summer Olympics",
"type": "Topic",
"link": "https://trends.google.com/trends/explore?q=football"
},
{
"mid": "/m/01l10v",
"title": "The UEFA European Football Championship",
"type": "Football championship",
"link": "https://trends.google.com/trends/explore?q=football"
},
{
"mid": "/m/0dpm1v",
"title": "Football",
"type": "Association football",
"link": "https://trends.google.com/trends/explore?q=football"
},
{
"mid": "/m/0gl2ny2",
"title": "Footballer",
"type": "Career",
"link": "https://trends.google.com/trends/explore?q=football"
}
]
}Last updated