Last active
December 23, 2015 07:29
-
-
Save ojas/6601403 to your computer and use it in GitHub Desktop.
Hoover's API Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suds==0.4 | |
wsgiref==0.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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