Easily generate QR codes dynamically using our API. Below you'll find all the necessary information to integrate the API into your application, including request details, parameters, and response formats.
https://qrcodegenerator.pw/api/v1/generate_qr.php
The API supports both GET and POST requests for maximum flexibility.
All requests require a valid API token. Include your token in the request as shown below:
?token=your_api_token
Parameter | Type | Description |
---|---|---|
data |
string | The content to encode in the QR code (e.g., a URL, plain text). |
size |
integer (optional) | Dimensions of the QR code in pixels. Default: 300 . |
color |
string (optional) | Hex code for the QR code's foreground color. Default: #000000 (black). |
background_color |
string (optional) | Hex code for the QR code's background color. Default: #FFFFFF (white). |
Below is an example of a GET request to generate a QR code:
https://qrcodegenerator.pw/api/v1/generate_qr.php?token=your_api_token&data=https://yourwebsite.com&size=300&color=FF5733&background_color=FFFFFF
If the request is successful, the API will return the QR code as a PNG image. For invalid requests, a JSON error response will be returned:
{
"error": "Rate limit exceeded. Try again later."
}
Each API token has usage limits. If the rate limit is exceeded, you'll receive the error message: {"error": "Rate limit exceeded. Try again later."}
.
Generate a QR code using the following cURL command:
curl -X GET "https://qrcodegenerator.pw/api/v1/generate_qr.php?token=your_api_token&data=https://yourwebsite.com&size=300&color=000000&background_color=FFFFFF"
Here's a simple example in Python for using the API:
import requests
url = "https://qrcodegenerator.pw/api/v1/generate_qr.php"
params = {
"token": "your_api_token",
"data": "https://yourwebsite.com",
"size": 300,
"color": "FF5733",
"background_color": "FFFFFF"
}
response = requests.get(url, params=params)
if response.status_code == 200:
with open("qr_code.png", "wb") as f:
f.write(response.content)
else:
print(response.json())
If you encounter any issues or need assistance, reach out to us at support@qrcodegenerator.pw.
QR Code Generator is your ultimate tool for creating high-quality QR codes for free. Use our API to integrate QR generation into your applications effortlessly.