How do you grab the data from there? Do you use ubot or something like that or do you use a script (PHP/Perl/Ruby)?
I use PHP with CURL, but the process is the same for any language.
Basically it break down like this;
NOTE: All request should save the returned cookie data and send any previously saved cookie data.
1) Login to Google. I use this URL 'https://www.google.com/accounts/ServiceLoginAuth', but there are a few different ones.
2) Request this url "https://adwords.google.com/um/StartNewLogin?sourceid=awo&subid=ww-en-et-gaia" and follow all the redirects, there are 6 (this is setting cookies need for Adwords).
3) When the last redirect complete and the HTML data is returned, extract the values for __u= and __c=. I use regex but any way will do.
4) Request this URL "https://adwords.google.com/o/Targeting/Explorer?stylePrefOverride=2&__u=&__c=" adding the values extracted for 'u' and 'c'. The URL should look something like "https://adwords.google.com/o/Targeting/Explorer?stylePrefOverride=2&__u=1654564568&__c=8794964564"
5) Extract the value for token, again I use regex
6) Send a POST request to the URL 'https://adwords.google.com/o/Targeting/file/DownloadAll' with the POST data outlined below.
7) (OPTIONAL) Decompress the data and format it with a CSV function.
You only have to go through the steps 1 to 5 every session, so if you have already scraped a keyword recently, you can just do step 6 with a new keyword, without repeating the login steps.
For the POST data you can modify some of the values to change the data returned, but unless specified, changing any of the other parameters will break this method and cause Google to return an error.
POST data;
$u is the __u value you extracted in step 3
$c is the __c value you extracted in step 3
$format can be CSV, GZIPPED_CSV, CSVFOREXCEL, XML or TSV
$county is a uppercase two letter country code, US, GB, DE, etc
$language is a lowercase two letter language code, en, jp, etc
$keyword is the keyword (do not url encode the keywords, leave a space as a space, don't change it to %20 or +)
$token is the token you extracted in step 5
This is the POST string for keywords
Code:
__u=$u&__c=$c&format=$format&selector=5|1|37|https://adwords.google.com/o/Targeting/|0BC91872D430CA67A5237BB62909C258|106|17t|110|en_US|ul|12g|11f|17k|11i|KEYWORD|COMPETITION|GLOBAL_MONTHLY_SEARCHES|AVERAGE_TARGETED_MONTHLY_SEARCHES|TARGETED_MONTHLY_SEARCHES|IDEA_TYPE|AD_SHARE|EXTRACTED_FROM_WEBPAGE|SEARCH_SHARE|KEYWORD_CATEGORY|NGRAM_GROUP|12x|19z|hh|$county|13a|hu|$language|139|17q|bm|13h|16x|17o|bl|$keyword|1|2|3|4|18|5|0|6|7|50|0|8|0|0|9|0|10|9|11|12|11|13|11|14|11|15|11|16|11|17|11|18|11|19|11|20|10|3|-8|11|21|11|22|10|4|23|24|1|25|26|0|27|24|1|28|29|30|31|32|2|33|34|35|36|-29|37|0|0|0|&token=$token
For example if you wanted to return gzip CSV format data for the keyword 'dog' with the location being 'United States', the language being 'english', the token being 'abcdef:1234567', the __c value '987654321' and the __u value '147852369', the POST string would look like;
Code:
__u=147852369&__c=987654321&format=GZIPPED_CSV&selector=5|1|37|https://adwords.google.com/o/Targeting/|0BC91872D430CA67A5237BB62909C258|106|17t|110|en_US|ul|12g|11f|17k|11i|KEYWORD|COMPETITION|GLOBAL_MONTHLY_SEARCHES|AVERAGE_TARGETED_MONTHLY_SEARCHES|TARGETED_MONTHLY_SEARCHES|IDEA_TYPE|AD_SHARE|EXTRACTED_FROM_WEBPAGE|SEARCH_SHARE|KEYWORD_CATEGORY|NGRAM_GROUP|12x|19z|hh|US|13a|hu|en|139|17q|bm|13h|16x|17o|bl|dog|1|2|3|4|18|5|0|6|7|50|0|8|0|0|9|0|10|9|11|12|11|13|11|14|11|15|11|16|11|17|11|18|11|19|11|20|10|3|-8|11|21|11|22|10|4|23|24|1|25|26|0|27|24|1|28|29|30|31|32|2|33|34|35|36|-29|37|0|0|0|&token=abcdef:1234567
This is the POST string for mobile keywords
Code:
__u=$u&__c=$c&format=$format&selector=5|1|38|https://adwords.google.com/o/Targeting/|0BC91872D430CA67A5237BB62909C258|106|17t|110|en_US|ul|12g|11f|17k|11i|KEYWORD|COMPETITION|GLOBAL_MONTHLY_SEARCHES|AVERAGE_TARGETED_MONTHLY_SEARCHES|TARGETED_MONTHLY_SEARCHES|IDEA_TYPE|AD_SHARE|EXTRACTED_FROM_WEBPAGE|SEARCH_SHARE|KEYWORD_CATEGORY|NGRAM_GROUP|12x|19z|hh|$county|13a|hu|$language|13d|139|17q|bm|13h|16x|17o|bl|$keyword|1|2|3|4|18|5|0|6|7|50|0|8|0|0|9|0|10|9|11|12|11|13|11|14|11|15|11|16|11|17|11|18|11|19|11|20|10|3|-8|11|21|11|22|10|5|23|24|1|25|26|0|27|24|1|28|29|30|31|32|33|2|34|35|36|37|-30|38|0|0|0|&token=$token
This is the POST string for website
Code:
__u=$u&__c=$c&format=$format&selector=5|1|35|https://adwords.google.com/o/Targeting/|0BC91872D430CA67A5237BB62909C258|106|17t|110|en_US|ul|12g|11f|17k|11i|KEYWORD|COMPETITION|GLOBAL_MONTHLY_SEARCHES|AVERAGE_TARGETED_MONTHLY_SEARCHES|TARGETED_MONTHLY_SEARCHES|IDEA_TYPE|AD_SHARE|EXTRACTED_FROM_WEBPAGE|SEARCH_SHARE|KEYWORD_CATEGORY|NGRAM_GROUP|12x|19z|hh|$county|13a|hu|$language|139|17q|bm|13i|19p|$website|1|2|3|4|18|5|0|6|7|50|0|8|0|0|9|0|10|9|11|12|11|13|11|14|11|15|11|16|11|17|11|18|11|19|11|20|10|3|-8|11|21|11|22|10|4|23|24|1|25|26|0|27|24|1|28|29|30|31|32|2|33|0|31|34|35|0|&token=$token