apyhub
MARKETING · SMART GENERATION

Generate QR Code API

Hosted on ApyHub

What it does

QR Code Generator creates downloadable QR codes or a cloud-hosted QR image from plain text, a vCard, or Wi‑Fi details. Send one input type per request, and you get back a QR code asset you can place on tickets, packaging, business cards, menus, or onboarding materials.

Use content for raw text or a URL, v_card for contact-sharing QR codes, or wifi_info to encode network access details. The vCard payload supports name and phone_numbers as required fields, plus optional email, notes, address, website, birthday, job_title, photo_url, organization, and social_profiles. Wi‑Fi QR codes accept ssid and optional password, auth_type, and is_hidden.

You can also brand the QR code with a logo, choose foreground_color and background_color, enable is_gradient for two-color foregrounds, and set recovery_level to control error correction. The service enforces the payload rules in the schema, including the one-input requirement and the color combinations, so you can validate QR generation before you ship it into a workflow.

Choose /download when you need the generated file directly, or /link when you want a pre-signed cloud URL in the response.

▣ ENDPOINT 01 / 02
POST
Generate QR code — download file
http://localhost:8080/apyhub/generate-qr-code/download
QUICKSTARTGUIDE

Quickstart

Create a QR code download from raw text or a URL, and name the output via the required query parameter.

curl -X POST "http://localhost:8080/apyhub/generate-qr-code/download?output=my-invite" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"https://apyhub.com","logo": "https://apyhub.com/logo.svg", }'

What you'll get back

Returns binary data (string with format: binary) — the downloaded QR code file itself.

TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Exactly one of `content`, `v_card`, or `wifi_info` must be provided.
URL of an image to overlay in the centre of the QR code.
v_card
phone_numbers
social_profiles
Raw text or URL to encode. Max 2953 characters.
wifi_info
Must be true when foreground_color is an array. Returns 400 if true but foreground_color is not an array.
Error correction level. Lower = more content capacity, less damage tolerance.
Hex background color. Required when foreground_color is set.
Solid mode: hex string (e.g. "000000"). Gradient mode: array of two hex strings ["startColor", "endColor"]. Must be omitted together with background_color, or both provided.

About this endpoint

What it does

Generates a QR code and returns it as a downloadable binary file. The request body can encode either raw content, a vCard, or Wi‑Fi information, and supports optional styling such as logo overlay, colors, gradient mode, and error-correction level.

Request Body

ParameterTypeMandatoryDescription
contentStringNoRaw text or URL to encode. Max 2953 characters. Exactly one of content, v_card, or wifi_info must be provided.
v_cardObjectNovCard payload. Exactly one of content, v_card, or wifi_info must be provided.
v_card.nameStringYesContact name.
v_card.emailStringNoEmail address.
v_card.notesStringNoNotes.
v_card.addressStringNoAddress.
v_card.websiteStringNoWebsite URL.
v_card.birthdayStringNoBirthday string.
v_card.job_titleStringNoJob title.
v_card.photo_urlStringNoPhoto URL.
v_card.organizationStringNoOrganization.
v_card.phone_numbersString ArrayYesPhone number list.
v_card.social_profilesObjectNoSocial profile links.
v_card.social_profiles.twitterStringNoTwitter handle or URL.
v_card.social_profiles.linkedInStringNoLinkedIn profile.
wifi_infoObjectNoWi‑Fi credentials payload. Exactly one of content, v_card, or wifi_info must be provided.
wifi_info.ssidStringYesWi‑Fi network name.
wifi_info.passwordStringNoWi‑Fi password.
wifi_info.auth_typeENUMNoAuthentication type. Allowed values: WEP, WPA, WPA2, WPA3, WPA-EAP, WPA2-EAP, WPA3-EAP.
wifi_info.is_hiddenBooleanNoWhether the network is hidden. Default: false.
logoStringNoURL of an image to overlay in the centre of the QR code.
is_gradientBooleanNoMust be true when foreground_color is an array. Returns 400 if true but foreground_color is not an array. Default: false.
recovery_levelENUMNoError correction level. Allowed values: low, medium, high, highest. Default: highest. Lower values increase content capacity but reduce damage tolerance.
background_colorStringNoHex background color. Required when foreground_color is set.
foreground_colorStringNoSolid mode: hex string (for example 000000). Gradient mode: array of two hex strings [startColor, endColor]. Must be omitted together with background_color, or both provided.

Response

Returns a binary file in the response body. The success response is a downloadable QR code file, with no JSON wrapper or named fields in the output schema.

Notes

Exactly one of content, v_card, or wifi_info must be provided. Also note that is_gradient must be true when foreground_color is an array, and background_color is required when foreground_color is set.

Query parameters

Name
Type
Description
outputOPTIONAL
string

Body

Name
Type
Description
bodyREQUIRED
object
Exactly one of `content`, `v_card`, or `wifi_info` must be provided.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.