#!/usr/bin/python
# -*- coding: utf-8 -*-
# We use the requests module:
# http://python-requests.org
import requests, json
# build the request
url = 'https://api.adresslabor.de/v1/de/check'
myParameters = {
'product' : 'EMX,SC,FK,PB,NC',
'firstname' : 'Max',
'lastname' : 'Mustermann',
'street' : 'Teststr.',
'hno' : '9',
'zip' : '12345',
'city' : 'Entenhausen',
'country' : 'DE',
'phone' : '01234/56789',
'email' : 'test@test-email.de',
'apicid' : 1,
'apikey' : 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
}
data = requests.post(url, myParameters)
# Parse json
# If you use an older version of the requests api,
# use the following to parse the json-result.
# json = json.loads(data.content)
json = data.json()
# Access the complete result.
print(json)
# Access the email-check-result.
print(json['em'])
# Access the email-resulttext.
print(json['em']['resulttext'])