Input:
Output:
Rules & Restrictions:
Send data via Base64 or an image URL or an image file.
Image size should not exceed 8 MB.
Also, the images should not be larger than 5000 pixels and smaller than 50 pixels.
import requests
api_url = 'https://mrz-scanner.p.rapidapi.com/ScanMRZ'
api_key = 'Your API Key'
image_path = 'Image directory path'
image_name = 'Image name'
files = {'image': (image_name, open(image_path + image_name, 'rb'), 'multipart/form-data')}
header = {
"x-rapidapi-host": "mrz-scanner.p.rapidapi.com",
"x-rapidapi-key": api_key
}
response = requests.post(api_url, files=files, headers=header)