Skip to content

Instantly share code, notes, and snippets.

@ojas
Last active December 23, 2015 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojas/6601403 to your computer and use it in GitHub Desktop.
Save ojas/6601403 to your computer and use it in GitHub Desktop.
Hoover's API Snippets
suds==0.4
wsgiref==0.1.2
from suds.client import Client
from suds.sax.element import Element
wsdl_url = 'http://hapi.hoovers.com/HooversAPI-40/hooversAPI/hooversAPI.wsdl'
api_key = 'YOUR_API_KEY'
api_usr = 'YOUR_USERNAME'
api_pwd = 'YOUR_PASSWORD'
duns = 884114609
client = Client(wsdl_url)
headers = []
headers.append(Element('API-KEY', ns=('sch', 'http://applications.dnb.com/webservice/schema/')).setText(api_key))
headers.append(Element('username', ns=('sch', 'http://applications.dnb.com/webservice/schema/')).setText(api_usr))
headers.append(Element('password', ns=('sch', 'http://applications.dnb.com/webservice/schema/')).setText(api_pwd))
client.set_options(soapheaders=headers)
resp = client.service.GetCompanyNews(duns)
print resp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment