One call to the free QR code API endpoint
Send a JSON body with a payload key holding the text to encode. Note the field name, because most other transform APIs on this service read a key called data instead.
curl -X POST https://aisenseapi.com/services/v1/qrcode_encode \
-H "Content-Type: application/json" \
-d '{"payload":"https://aisense.no/free-public-apis"}'{
"qrcode_image": "iVBORw0KGgoAAAANSUhEUg...",
"image_type": "png"
}That is the whole contract. There is no key to request, no account to create and no signup step. The service-wide limit is 5000 requests per IP per 24 hours.
The two response fields
The free QR code API endpoint answers with exactly two keys, and neither one is optional.
| Field | Type | Description |
|---|---|---|
| qrcode_image | string | The complete PNG file, Base64 encoded. Decode it before saving or displaying the image. |
| image_type | string | Always png. No other output format is offered. |
The response arrives as Content-Type: application/json with Access-Control-Allow-Origin: *, so a browser can call the endpoint directly from a page. Feed the string straight into an image tag by prefixing it with data:image/png;base64,.
What belongs in the payload field
Anything a scanner should read. A URL, a product code, a Wi-Fi string, a short instruction for a phone. The value travels in the POST body rather than the URL, so it never lands in a request path or a server log line.
Length changes the picture. Short input produces a small grid, and longer input produces a denser one. The eight character string AI SENSE came back as a 250 by 250 pixel PNG, while the 35 character URL above produced 410 by 410 pixels. Read the width from the image rather than assuming a fixed size.
There is a practical ceiling. A payload of 1800 characters still returned a valid image during testing, but 2000 characters did not return valid JSON at all. Keep the content short. QR codes are meant to carry a pointer, not a document, so store the long text somewhere else and encode the link to it.
Two calls, two different strings
The same payload does not produce the same Base64 twice. Each generated PNG carries a tEXt comment chunk reading AISENSE followed by a Unix timestamp, plus a tIME chunk. Both change every second, so the bytes change with them.
This matters for two habits. Do not use qrcode_image as a cache key, and do not assert on the exact string in a test. Compare the decoded content instead, which is stable: send an image back through the decode endpoint and check the value it reports.
The visible grid is identical across calls. Only the metadata differs, so every version of the image scans to exactly the same content.
Errors
| Status | Body | Cause |
|---|---|---|
| 400 | {"error":"No payload."} | The body carried no usable payload value. An empty string counts as none. |
That is the only failure mode. Three mistakes land on that same response. A GET request with a query string returns it, because the endpoint is POST only. A form encoded body returns it, because the body must be JSON. A JSON body using some other key name, such as text, returns it as well.
Reading a code goes the other way
Generating and reading are separate calls. The QR code decode API endpoint takes a Base64 image or a file upload and answers with qrcode_content. A round trip is exact: a PNG produced here and sent straight back reports the original string.
Pick by direction. Text going in means encode. An image returning to its original text means decode. Neither endpoint guesses which way you meant.
Other transforms sit nearby. Build a clean path segment from a title with the Slugify API endpoint before you encode the link, or wrap binary content for a text channel with the Base64 encode API endpoint. The Encoding APIs hub lists every encode and decode pair, and the full catalogue of free public REST APIs adds hashing, identifiers and storage.
Common uses
Print and signage
Drop a URL into a poster, a label or a receipt so a phone camera can open it.
Device handover
Move a short configuration value from a screen to a camera without typing it.
Ticketing and passes
Encode an identifier that a scanner at the door checks against your own records.
Agent output
Let a language model with HTTP access produce a scannable image in a single call.
Privacy and limits
A QR code is an encoding, not a cipher. Anyone who can point a camera at the image can read the payload, so it hides nothing. Keep secrets, tokens and personal data off any public endpoint.
Payloads travel in the POST body, never in the URL. The free QR code API endpoint issues no key and opens no account. The service-wide limit is 5000 requests per IP per 24 hours, counted across every service on the same base URL.