Generate QR Code API
ApyHub
30 atoms
Base tier
About
This API lets you dynamically generate QR codes.
This API generates personalized QR Codes by adding colors and logos to make them unique and branded. The generated codes can be scanned using a smartphone or other mobile device, providing quick and easy access to information such as product details, promotions, contact information, or WiFi details. The generated QR codes can be accessed and scanned offline, allowing for easy access to information even in areas with limited internet connectivity.
Try out the API in the API playground and see how this free online QR code generator API can help you generate QR codes, save time, and improve your users and visitors experience with a simple API call.
Select API Endpoints
Output
API Playground
API Documentation
generate qr code file
POST
https://api.apyhub.com/generate/qr-code/file
Request example
Method:
POST
Content Type:
application/json
Query Parameter(s)
Attribute | Type | Mandatory | Description |
---|---|---|---|
output | String | No | The name for the QR code file. If no output attribute is provided, the default file name will be output.png |
Request Body
Attribute | Type | Mandatory | Description |
---|---|---|---|
content | String | Yes (If v_card and wifi_info are not provided) | Any text or url for which you want to generate QR Code. |
logo | String | No | Url of the logo you want in QR Code. Accepts png , jpeg and svg . |
background_color | String | No | Background color of the QR Code in Hexadecimal format. Defaults to #000000 (black). |
foreground_color | String or Array | No | Foreground color of the QR Code in Hexadecimal format. Defaults to #ffffff (white). Accepts input as String if one/solid color is used or accepts an Array of String with start and end colors, for a gradient. |
v_card.name | String | Yes | Name of the contact. |
v_card.phone_numbers | Array | Yes | Phone numbers of the contact. |
v_card.organization | String | No | Organization of the contact. |
v_card.job_title | String | No | Job title of the contact. |
v_card.address | String | No | Address of the contact. |
v_card.email | String | No | Email address of the contact. |
v_card.website | String | No | Website url of the contact. |
v_card.photo_url | String | No | Url of the photo of the contact. |
v_card.birthday | String | No | Birthday of the contact in 'YYYYMMDD' format. |
v_card.notes | String | No | Any additional notes you want to save for the contact. |
wifi_info.ssid | String | Yes | Name of the wifi. |
wifi_info.password | String | Yes (If auth_type is provided) | Password of the wifi, for password protected wifi. |
wifi_info.auth_type | String | Yes (If password is provided) | Authentication type of the wifi, for password protected wifi. |
Sample Requests
vCard
Wi-Fi
Sample Response
A successful request returns the QR code image file.
HTTP Response Codes
The method may return one of the following HTTP status codes:
Status Code | Description |
---|---|
200 | The request was successful. |
401 | Required authentication information is either missing or not valid for the resource. |
400 | Invalid input - the content is empty |
500 | If any unexpected error occurs while processing the request |
Authentication
All API requests to ApyHub services need to be authenticated. Currently we support
tokens
or basic authentication
mechanisms.
You can generate and view your existing credentials from your workspace settings (on the left side of the navbar) and go to “API Keys".Points to note:
- Credential secrets are generated on the fly and are not stored in plain text, so on generating a credential please save the secrets somewhere safe.
- Use the
apy-token
as the header parameter to pass the token. - Use the
Authorization
header to send the basic authentication credentials.
Error codes
To search for a specific error code, enter the code in the search box below. Alternatively, you can click on the button to view a complete list of all error codes.
Table of contents