Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizKindly log in to use this feature. We’ll take you to the login page automatically.
LoginGeneral Tech Bugs & Fixes 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
Google trends does not allow a search on a range of two years, but one year at time.
Using pyGTrends.py you could do:
from import pyGTrends
from csv import DictReader
r = pyGTrends(username, password)
r.download_report(('stackoverflow'), date='2009')
export1 = DictReader(r.csv().split('\n'))
r.download_report(('stackoverflow'), date='2010')
export2 = DictReader(r.csv().split('\n'))
then you could join export1 and export2 to suit your needs.
OR even better
You could download the report without date filter and do the dirty job with Python.
Have a look to the following script, arrange date_MIN\date_MAX as you need.
from pyGTrends import pyGTrends
import csv
import datetime
date_MIN ='2007/01/01'
date_MAX ='2009/03/01'
r = pyGTrends('username','password')
r.download_report(('stackoverflow'))
csv_reader = csv.reader(r.csv().split('\n'))
with open('gtrends_report.csv', 'w') as csv_out:
csv_writer = csv.writer(csv_out)
for count,row in enumerate(csv_reader):
if count == 0:
csv_writer.writerow(row)
else:
date = datetime.datetime.strptime(row[0], "%b %d %Y")
if datetime.datetime.strptime(date_MIN, "%Y/%m/%d") <= date <= datetime.datetime.strptime(date_MAX, "%Y/%m/%d"):
csv_writer.writerow(row)
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I'm looking to find an api/program/interface to get the following information.
I would like to see the amount of times a particular search term was used and its /weekly/monthly/yearly popularity breakdown along with its rank in a particular page.
I've found googlesearchpositionfinder.com and google.com/trends but i have 5000 terms to search for by hand is not happening. I've also found www.juiceanalytics.com/openjuice/programmatic-google-trends-api but it doesn't allow me to do a break down for a period of 2 years.
Basically i'm trying to create a ranking of search phrases, the weeks(period) they were more popular and how a particular site(e.g urban dictionary) showed up in googles search rankings for the terms. See above (1-2)
Also this doesn't have to be in python this is just what I've found to build with...
Latest edit: Both answers below helped.
I ended up using curl against google directly and then parsing the results with a c# program.