QR-Code Generator API
This documentation offers details on how to interact with our free QR Code generation API.
The API allows you to generate QR codes with different types of content: Text / URL, vCard, WiFi, and geolocation.
Additionally, the API provides the option to customize the background and foreground colors of the QR code.
Note: We DON'T store the queries you may send to our APIs.
Your QR code file is automatically removed from its temporary hosting 24 hours after its creation.
Qr Code Generator API Request example
Method: POST
Content Type: application/json
Endpoint: https://aaapis.com/api/v1/generate/qr-code/
curl --L --X POST 'https://aaapis.com/api/v1/generate/qr-code/' \
--H 'Authorization: Token YOUR_TOKEN' \
--H 'Content-Type: application/json' \
--data-raw '{
"content":"HelloWorld!",
"background_color": "#ffffff",
"foreground_color": "#000000"
}'Response
A successful request will return a temporary, signed URL that points to the generated QR code image file.
Note: The barcode image file will be available for 1 hour. After that, the file will be automatically deleted after 24 hours.
Qr Code Generator API Parameters
| Parameter | Type | Optionnal | Description |
|---|---|---|---|
| content | string | No (if v_card, wifi or geo aren't provided) | Used to specify the text or url that will be encoded into the QR code. |
| background_color | string | Yes | Used to specify the background color of the QR code. It must be a valid Hex color code. The default value is #ffffff (white). |
| foreground_color | string | Yes | Used to specify the background color of the QR code. It must be a valid Hex color code. The default value is #000000 (black). |
| wifi | dictionnary | Yes | Used to specify the wifi information that will be encoded into the QR code. |
| wifi.ssid | string | No | SSID of the WiFi network. We don't store the SSID. |
| wifi.security | string | No | Authentication type. The value should be “WEP”, “WPA” or "nopass". We don't store the auth type. |
| wifi.password | string | Yes (only if security is nopass) | Pass of the WiFi network. We don't store the password. |
| v_card | dictionnary | Yes | Used to specify the vCard information that will be encoded into the QR code. |
| v_card.name | string | No | Name of the contact. |
| v_card.display_name | string | No | Display name of the contact. |
| v_card.nickname | string | Yes | Nickname of the contact. |
| v_card.organization | string | Yes | Company / organization of the contact. |
| v_card.job_title | string | Yes | Job title of the contact. |
| v_card.phone_numbers | array | Yes | Phone number of the contact. Multiple values are allowed. |
| v_card.homephone | array | Yes | Home phone of the contact. Multiple values are allowed. |
| v_card.cellphone | array | Yes | Cell phone of the contact. Multiple values are allowed. |
| v_card.worphone | array | Yes | Work phone of the contact. Multiple values are allowed. |
| v_card.email | array | Yes | Email of the contact. Multiple values are allowed. |
| v_card.street | string | Yes | Street address of the contact. |
| v_card.city | string | Yes | City of the contact. |
| v_card.region | string | Yes | Region of the contact. |
| v_card.zipcode | string | Yes | Zip code of the contact. |
| v_card.country | string | Yes | Country of the contact. |
| v_card.website | string | Yes | Website of the contact. |
| v_card.photo_url | string | Yes | URL of the photo of the contact. |
| v_card.birthday | string | Yes | Birthday of the contact in YYYY-MM-DD format. |
| v_card.notes | string | Yes | Additionnal notes about the contact. |
| geo | dictionnary | Yes | Used to specify the geographic information that will be encoded into the QR code. |
| geo.latitude | float | No (if geo isn't specified) | Latitude of the geolocation. |
| geo.longitude | float | No (if geo isn't specified) | Longitude of the geolocation. |
More Qr Code Generator API request examples
Here is an example of a vCard with a dark blue foreground.
curl --L --X POST 'https://aaapis.com/api/v1/generate/qr-code/' \
--H 'Authorization: Token YOUR_TOKEN' \
--H 'Content-Type: application/json' \
--data-raw '{
"v_card" : {
"name": "John Doe",
"display_name": "John",
"organization": "Acme Inc.",
"job_title": "Developer",
"email": "[email protected]"
},
"foreground_color": "#00008b"
}'Here is an example of a WiFi network:
curl --L --X POST 'https://aaapis.com/api/v1/generate/qr-code/' \
--H 'Authorization: Token ' \
--H 'Content-Type: application/json' \
--data-raw '{
"wifi" : {
"ssid": "MyNetwork",
"security": "WPA",
"password": "mypassword"
}
}'Here is an example of a geolocation:
curl --L --X POST 'https://aaapis.com/api/v1/generate/qr-code/' \
--H 'Authorization: Token ' \
--H 'Content-Type: application/json' \
--data-raw '{
"geo" : {
"latitude": 40.712776,
"longitude": -74.005974
}
}'HTTP Response Status Codes
Aaapis employs standard HTTP response codes to signify the outcome, whether successful or unsuccessful, of an API request.Typically, codes falling within the 2xx range signify success. Codes within the 4xx range indicate an error attributable to inadequate information provided (e.g., a missing required parameter). Codes in the 5xx range denote an error related to Aaapis' servers.
| Code | Description |
|---|---|
| 200 | This status code indicates that the request was successful. The server successfully processed the request and is sending back the requested data. In the context of the QR Code generation API, this status code would be returned when a QR code is successfully generated. |
| 401 | This status code indicates that the request requires user authentication. The server received the request, but it needs authentication to fulfill it. This could mean that the Authorization header is missing or invalid. |
| 400 | This status code indicates that the server could not understand the request due to invalid syntax. This could mean that the JSON object in the request is malformed or missing required fields. The client must modify the request and try again. |
| 500 | This status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This could be due to a problem with the server itself. The client should not modify the request and can try again later. |
Explore our guides for the QR code generator API:
- The Quick Response Code: A Tiny Tool with a Big Impact
Quick Response (QR) Codes have become an integral part of our digital lives. From restaurant menus to product packaging, these pixelated squares are every…
- What security measures should businesses take when implementing QR codes to ensure customer data privacy?
When implementing QR codes, businesses should take several security measures to ensure customer data privacy.
- How Businesses Benefit from Using QR Codes
Quick Response (QR) codes have surged in popularity and utility in the business world, offering a bridge between offline and online experiences. These two…
- Can QR codes be used for mobile payments, and how does that process work?
Yes, QR codes can indeed be used for mobile payments. This method of payment has become increasingly popular due to its convenience, speed, and security. …
- Simplifying WiFi Access with QR Codes
One area where QR codes shine particularly bright is in providing easy access to WiFi networks. This article will explore the benefits of using QR generat…