curl --request GET \
--url 'https://{RAPIDAPI HOST}/v1/qrcode?data=http://candybar.pw' \
--header 'X-RapidAPI-Host: {RAPIDAPI HOST}' \
--header 'X-RapidAPI-Key: {YOUR RAPIDAPI KEY}' \
--output qr.png
Code128
Code39
PDF417
import requests
headers = {
"X-RapidAPI-Key": "YOUR RAPIDAPI KEY",
"X-RapidAPI-Host": "candybar-barcode-api.p.rapidapi.com"
}
response = requests.get(
url="https://candybar-barcode-api.p.rapidapi.com/v1/code128",
params={"data":"Great Barcodes!"}, headers=headers)
if response.status_code == 200:
with open("code128.png", "wb") as f:
f.write(response.content)
import requests
headers = {
"X-RapidAPI-Key": "YOUR RAPIDAPI KEY",
"X-RapidAPI-Host": "candybar-barcode-api.p.rapidapi.com"
}
files = {
"file": open("./usps.jpg", "rb")
}
response = requests.post(url, headers=headers, files=files)
if response.status_code == 200:
print(response.json())
[
{
'code_type': 'QRCODE',
'contents': 'https://qr.usps.com/rl?s=m&t=6'
},
{
'code_type': 'CODE128',
'contents': '420200440100\x1d9259812345678000000199'
}
]