olemis

Google Adwords traffic estimates sample

Nov 3rd, 2010
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. # Author: Olemis Lang
  2.  
  3. from adspygoogle.common import SOAPPY
  4. from adspygoogle.common.Errors import Error
  5. from adspygoogle.adwords.AdWordsClient import AdWordsClient
  6.  
  7. from pprint import pprint
  8.  
  9. headers = {
  10.       'email' : 'user@notgoogle.com',
  11.       'password' : 'canhurtyoureyes',
  12. #      'clientEmail' : 'user@notgoogle.com',
  13.       'useragent' : "UA",
  14.       }
  15.  
  16. headers['developerToken'] = 'dt_works_with_v13'
  17. headers['applicationToken'] = 'at_works_with_v13'
  18.  
  19. namespace = namespace_v13 = 'https://adwords.google.com'
  20. v201008 = 'v201008'
  21. v13 = 'v13'
  22. VER_LATEST = v201008
  23.  
  24. client = AdWordsClient(headers, {'soap_lib' : SOAPPY})
  25. estimator_service = client.GetTrafficEstimatorService(namespace_v13, v13)
  26.  
  27. kwds = [{
  28.                 'text': 'dsl',
  29.                 'maxCpc': '1000000',
  30.                 'type': 'Broad'
  31.           },
  32.         {
  33.                 'text': 'google',
  34.                 'maxCpc': '1000000',
  35.                 'type': 'Broad'
  36.           }, ]
  37.  
  38. estimates = estimator_service.EstimateKeywordList(kwds)
  39. pprint(estimates)
Add Comment
Please, Sign In to add comment