QR Codes Bridge Offline to Online
QR codes are a popular type of two-dimensional barcode that can easily be read by mobile phones. They are often used to code actionable text, such as a link (for example, to an online restaurant menu or shopping cart link), a file (for example, a Dropbox or Google Drive link), Google Maps pin, contact information, a telephone number.
How to scan a QR Code
On Android and iOS devices, simply open the camera app and point it at a QR code for a few seconds, until it comes into focus — there's no need to take a photo. The camera app will automatically detect the code and show a notification. Tap the notification to open the link associated with the QR Code.
For example, try scanning: (Google Maps Pin - Eiffel Tower, Paris)Examples from the Wild
Business cards, flyers, brochures, product packaging, food packaging, stickers (for example, link to re-order consumables), posters, stationery, banners, tickets, print adverts, billboards, catalogs, digital signage, TV commercials, coupons, giveaways, conference badges. The possibilities are endless to drive consumer action with QR Codes.
API Designed for Ease
We have optimized for ease of implementation. All API methods are accessible via simple HTTP calls. Most implementations of this API take less than 15 minutes to setup. Simply call the provided URLs with their respective parameters, and you're done.
Getting Started: Authentication
All API endpoints require API authentication credentials to be supplied as query arguments (apikey
). To get started, you'll need a free Shareaholic account and Site ID. Signup for an account and then add your site to get your Site ID. The Site ID is your API Key for the QR Code Generator API.
Example:
...&apikey=8943b7fd64cd8b1770ff5affa9a9437b&...
Note: the apikey used in this document is intended for use as an example only. It is subject to change.
Parameters
Endpoint:https://www.shareaholic.com/v2/qrcode/
Parameter | Description | Required | Example |
---|---|---|---|
apikey |
API Key | Required | apikey=8943b7fd64cd8b1770ff5affa9a9437b |
content |
QR content | Required | content=https://example.com |
image_format |
Image format | Optional | image_format=svg (svg|png) |
size |
Size of Image | Optional; only used for png images | size=320 |
color |
Foreground color | Optional | color=000 |
fill |
Background color | Optional | fill=ffffff |
QR Codes can encode many types of actionable text. Text representing contact information, when recognized, could trigger a prompt to add the contact to an address book. Other examples include URL, Email Address, Telephone Number, vCard/Contact Info, SMS/MMS/Facetime, Maps, Calendar Events, Wifi Network, iTunes/AppStore. More here.
Working Example:
Open Instagram and go to a profile:
https://www.shareaholic.com/v2/qrcode/?content=https://instagram.com/getdhi&image_format=svg&apikey=8943b7fd64cd8b1770ff5affa9a9437b
Result:
(Try scanning the QR Code above with your mobile phone! Open the camera app on your phone and point it to this QR code for a few seconds, until it comes into focus)
Error codes
Code | Description |
---|---|
0 | An internal error has occurred and been logged. |
100 | apikey not provided |
101 | apikey provided is invalid |
110 | content not provided |
429 | rate_limit_exceeded |
Example error response:
{
"errors":[
{
"code":"101",
"source":{
"pointer": "/data/attributes/apikey"
},
"detail": "Invalid apikey. See https://www.shareaholic.com/api/qrcode/ for usage examples."
}
]
}
Scan Tracking
You can track the number of scans, where, and when it was scanned by pairing this API up with the Shortener API.
Rate Limits
In order to maintain an efficient, secure, and high-performing API, there are limits on how many times this API can be called in any given period. If you exceed your per-hour or per-minute call limit, you will receive a rate_limit_exceeded
429 error. To increase your limit, subscribe to a higher plan or contact your account manager for assistance. API responses include X-RateLimit-*
headers that describe rate limit usage.
Feedback
If you believe you have found a bug, or you’d like to request additional functionality, or you release something using this API, we’d love to hear from you.