QR Codes

QR Codes are 2-dimensional bar-codes which may be encoded to carry a variety of information that is then read using a cell phone or other camera-based device. Gravatar provides simple QR codes which contain a link back to the main profile page for the requested profile.

Base Request

Making a QR request is likely to follow these steps (assuming you have an email address already):

  1. Create a valid email hash
  2. Build the URL to request a profile page (e.g. https://gravatar.com/{hash})
  3. Append .qr to that URL to indicate that you want the results in QR Code format

Once you have done the above, you should end up with a URL that looks something like this:

https://gravatar.com/27205e5c51cb03f862138b22bcb5dc20f94a342e744ff6df1b8dc8af3c865109.qr

When you request that URL (you can do it in your browser) you should get a QR Code image in PNG format that will link directly to the profile page of the requested user when scanned by a QR-compatible device.

Request Options

The QR Code format supports a single option/parameter, size (or s), which is used to specify the edge length of the desired QR code image. Since they are square, you only need to specify a single pixel-based value:

https://gravatar.com/27205e5c51cb03f862138b22bcb5dc20f94a342e744ff6df1b8dc8af3c865109.qr?s=20

Example

Using the above QR code in an img tag produces the following:

<img src="https://gravatar.com/27205e5c51cb03f862138b22bcb5dc20f94a342e744ff6df1b8dc8af3c865109.qr?s=150" />

Tips

  1. QR codes default to 80px by 80px if you don’t supply a size parameter, just like normal Gravatars.
  2. The only data currently encoded in the QR Code is a link back to the profile page.
  3. Modern mobile devices can read QR codes right from the camera. Otherwise, the app stores should be plenty of specific QR readers shall you need one.
  4. As with all profile data formats, profile requests will only resolve for the hash of the primary address on an account. Users may have multiple addresses on a single account, so while a Gravatar image request may return a result, a profile request for the same hash may not.

Provide a link to gravatar.com/profile and let your users know how to edit their Gravatar profile. Use of our free APIs is governed by these Guidelines for Responsible Use. Documentation is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


Last updated on:

Blog at WordPress.com.