All Collections
API & Developers
API sample code in python
API sample code in python

Quick example of using python to connect to the API and run a query for all emails for a domain.

Pardeep Kullar avatar
Written by Pardeep Kullar
Updated over a week ago

We're using the company endpoint to get emails for one domain.

You pass in the domain, then pass in your API key (which you get from your account settings) as a header.

data = {'domain': domain}
headers = {'X-Api-Key': 'yourApiKey'}

resp = requests.post('https://api.anymailfinder.com/v4.0/search/company.json', data=data, headers=headers)

data = json.loads(resp.content)


Remember, it's a POST request!

You can begin with the API docs here: https://anymailfinder.com/api/

If you want, test the API in the www.getpostman.com app first. It's a good app :)

Did this answer your question?