SOURCE CODE
app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import requests api_key = 'your_api_key' email = 'example@email.com' url = 'https://api.emailvalidation.com/v1/validate?api_key=' + api_key + '&email=' + email response = requests.get(url) if response.status_code == 200: data = response.json() if data['is_valid']: print(email + ' is a valid email') else: print(email + ' is not a valid email') else: print('Error while validating the email') |
As you can see in the above code we are importing the requests
module and after that you need to copy paste the api_key
and after that you need to validate the given
email address and after that we are printing the status
of the validity of the email.