AAAPIS.COM - Free APIs for developers

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

ParameterTypeOptionnalDescription
contentstringNo (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_colorstringYesUsed to specify the background color of the QR code. It must be a valid Hex color code. The default value is #ffffff (white).
foreground_colorstringYesUsed to specify the background color of the QR code. It must be a valid Hex color code. The default value is #000000 (black).
wifidictionnaryYesUsed to specify the wifi information that will be encoded into the QR code.
wifi.ssidstringNoSSID of the WiFi network. We don't store the SSID.
wifi.securitystringNoAuthentication type. The value should be “WEP”, “WPA” or "nopass". We don't store the auth type.
wifi.passwordstringYes (only if security is nopass)Pass of the WiFi network. We don't store the password.
v_carddictionnaryYesUsed to specify the vCard information that will be encoded into the QR code.
v_card.namestringNoName of the contact.
v_card.display_namestringNoDisplay name of the contact.
v_card.nicknamestringYesNickname of the contact.
v_card.organizationstringYesCompany / organization of the contact.
v_card.job_titlestringYesJob title of the contact.
v_card.phone_numbersarrayYesPhone number of the contact. Multiple values are allowed.
v_card.homephonearrayYesHome phone of the contact. Multiple values are allowed.
v_card.cellphonearrayYesCell phone of the contact. Multiple values are allowed.
v_card.worphonearrayYesWork phone of the contact. Multiple values are allowed.
v_card.emailarrayYesEmail of the contact. Multiple values are allowed.
v_card.streetstringYesStreet address of the contact.
v_card.citystringYesCity of the contact.
v_card.regionstringYesRegion of the contact.
v_card.zipcodestringYesZip code of the contact.
v_card.countrystringYesCountry of the contact.
v_card.websitestringYesWebsite of the contact.
v_card.photo_urlstringYesURL of the photo of the contact.
v_card.birthdaystringYesBirthday of the contact in YYYY-MM-DD format.
v_card.notesstringYesAdditionnal notes about the contact.
geodictionnaryYesUsed to specify the geographic information that will be encoded into the QR code.
geo.latitudefloatNo (if geo isn't specified)Latitude of the geolocation.
geo.longitudefloatNo (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.

CodeDescription
200This 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.
401This 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.
400This 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.
500This 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: