Python Forum

Full Version: How can I get Python Bulk Email Verification Script With API?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Everyone,
I have an email verification API and I want to use it through Python.
I wanna make a Python script identical may be it should accept email list in the form of text or csv file, checks them through the API, then exports the results in each file accordingly; Valid, Invalid and Unknown.

How to do it? And is there an already template that I can obtain and just add my API key to it?

Thanks in Advance
Using Requests is the common way to talk to an API in Python.
Most API will get JSON back,so when use Requests will automatically decode return JSON to a Python dictionary.
Example.
>>> import requests
>>> 
>>> response = requests.get('https://api.github.com/users/defunkt')
>>> response.status_code
200
# Get json return data
>>> data = response.json()
>>> data['login']
'defunkt'
>>> data['bio']
'🍔'

# As it's now a dictionary can eg use get() method 
>>> data.get('name', 'No data from this requests')
'Chris Wanstrath'
>>> data.get('car', 'No data from this requests')
'No data from this requests'