This month's use
GET /api/v1/usage
The team's plan, the calls in the current month and the limit. The simplest way to check that a key works; the call itself counts.
Response: 200 JSON
Barcodes and QR codes from your program. The same symbologies, the same rules and the same renderer as the free generators on qreska.com, and the dynamic codes of the panel.
The API comes with the Business plan (10,000 calls a month) and the Pro plan (100,000 calls a month). Keys are made in the panel, on its API page.
Go to the panelEvery route is under https://app.qreska.com/api/v1. Each call carries the key in a header, never in the address, because addresses end up in logs and browser history. Do not put the key in page code that reaches a browser: the API is for your server.
An API key from the panel, in the Authorization: Bearer qrk_… headerEvery route described in OpenAPI 3.1, for Postman, Insomnia or a client generator: https://app.qreska.com/api/v1/openapi.json
The content of static codes is drawn in memory and forgotten once the answer is sent. The call log you see in the panel has the time, key, method, route without data, result and response time — no content and no IP address. Details in the privacy policy.
An EAN-13 as PNG at 600 dpi:
curl -X POST https://app.qreska.com/api/v1/barcodes \
-H "Authorization: Bearer $QRESKA_KEY" \
-H "Content-Type: application/json" \
-d '{"symbology":"ean-13","data":"590123412345","format":"png","dpi":600}' \
-o ean-13.pngA dynamic code, then a change of its target:
curl -X POST https://app.qreska.com/api/v1/codes \
-H "Authorization: Bearer $QRESKA_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Flyer","target":{"type":"url","url":"https://example.com/offer"}}'
curl -X PATCH https://app.qreska.com/api/v1/codes/$CODE_ID \
-H "Authorization: Bearer $QRESKA_KEY" \
-H "Content-Type: application/json" \
-d '{"target":{"type":"url","url":"https://example.com/winter"}}'Two small libraries without dependencies: for Node.js 18+ (TypeScript, fetch) and for PHP 8.1+ (curl). They handle the key, errors as exceptions carrying the code from the table above, a retry after 429 rate_limited, and paging through the list of codes. Until they are published on npm and Packagist they install from the sdk/js and sdk/php folders of the repository.
JavaScript and TypeScript:
import { Qreska } from "@qreska/sdk";
const qreska = new Qreska({ apiKey: process.env.QRESKA_KEY });
const file = await qreska.barcode({ symbology: "ean-13", data: "590123412345", format: "png" });
const code = await qreska.codes.create({
name: "Flyer",
target: { type: "url", url: "https://example.com/offer" },
});PHP:
$qreska = new \Qreska\Client(getenv('QRESKA_KEY'));
$file = $qreska->barcode(['symbology' => 'ean-13', 'data' => '590123412345', 'format' => 'png']);
file_put_contents('ean-13.png', $file->data);
$code = $qreska->createCode([
'name' => 'Flyer',
'target' => ['type' => 'url', 'url' => 'https://example.com/offer'],
]);GTIN/EAN numbers are issued by GS1 (in Poland: GS1 Polska). Qreska only draws the code from a number you already have.
ISBNs are issued by the national ISBN agency (in Poland: the ISBN office of the National Library). Qreska only draws the code from a number you already have.
ISSNs are issued by the national ISSN centre (in Poland: the ISSN centre of the National Library). Qreska only draws the code from a number you already have.
Errors come as application/problem+json (RFC 9457). The code field is fixed, for programs to compare; title is for people, in Polish or English after the Accept-Language header. On validation errors, errors names the fields: path is the place in the request body, code is the reason.
| Code | Status | Meaning |
|---|---|---|
| unauthorized | 401 | No API key, or the key is unknown or revoked. |
| forbidden | 403 | This organization's plan does not include the API. |
| suspended | 403 | The organization is suspended pending review: it cannot create codes or change targets. |
| not_found | 404 | There is no such resource in this organization. |
| invalid_request | 400 | The request is not valid JSON or does not match the schema. |
| invalid_data | 422 | This content cannot be encoded in the chosen symbology. |
| blocked_target | 422 | This address is on the block list, or leads to fraud or malware. |
| plan_limit | 409 | The plan does not allow more dynamic codes. |
| quota_exceeded | 429 | The plan's monthly allowance of API calls is used up. |
| rate_limited | 429 | Too many calls a second. Try again in a moment. |
| internal | 500 | An error on our side. Try again; if it keeps happening, write to us. |
GET /api/v1/usage
The team's plan, the calls in the current month and the limit. The simplest way to check that a key works; the call itself counts.
Response: 200 JSON
GET /api/v1/symbologies
The symbologies POST /api/v1/barcodes takes: id, kind, example, default sizes in mm, switches with their values, and who issues the numbers.
Response: 200 JSON
GET /api/v1/qr-contents
The content types of the qrContent field (Wi-Fi, business card, email, bank transfer…) with their fields. The same as on the /qr pages.
Response: 200 JSON
POST /api/v1/barcodes
Draws a code from the content given and returns a file in the format asked for. The value after normalization, with its check digit for instance, is in the Qreska-Value header; warnings that did not stop the drawing (contrast, module size) in Qreska-Warning.
| Field | Type | Values | Description |
|---|---|---|---|
| symbologyrequired | string | one of: ean-13, ean-8, upc-a, upc-e, isbn, issn, itf-14, gs1-128, code-128, code-39, interleaved-2-of-5, codabar, pharmacode, data-matrix, gs1-data-matrix, pdf417, aztec, micro-qr, qr | The symbology, as in the generator's address: ean-13, code-128, qr… |
| data | string | up to 8000 characters | The code's content. For QR, qrContent can be given instead. |
| qrContent | object | For qr only: a content type and its field values; the content is built from them as on the /qr page. | |
| addon | string | up to 5 characters | A 2- or 5-digit add-on, for symbologies that have one (EAN-13, UPC-A, ISBN…). |
| options | object | The symbology's switches, such as errorCorrection for QR. Listed by GET /api/v1/symbologies. | |
| format | string | one of: svg, png, pdf, json; default "svg" | The file format. |
| moduleWidthMm | number | 0.1 to 5 | Module width (X) in mm. |
| barHeightMm | number | 3 to 300 | Bar height in mm, for linear codes. |
| hri | object | The text under a linear code: whether to show it and the digit height in mm. | |
| colors | object | #RRGGBB colours of the bars and the background. Red and orange bars on linear codes are refused: a laser scanner cannot see them. | |
| rotation | number | one of: 0, 90, 180, 270 | Rotation in degrees. |
| moduleShape | string | one of: square, rounded, dot | For qr only: the shape of the modules. |
| dpi | integer | 72 to 1200; default 300 | PNG resolution. Every module is a whole number of pixels, and the DPI written to the file matches the size in mm. |
| object | The PDF page: fitted to the code with a margin, or A4. |
Response: 200 A file: SVG, PNG, PDF, JSON
GET /api/v1/codes
The team's codes, newest first, a page at a time. The next page is fetched with the cursor from nextCursor; null means the end of the list.
| Field | Type | Values | Description |
|---|---|---|---|
| q | string | up to 200 characters | Search the name, the code's address and the target address. |
| projectId | string | up to 100 characters | Only codes in this project. |
| limit | integer | 1 to 100; default 50 | Codes per page. |
| cursor | string | up to 200 characters | The cursor from the previous page's nextCursor. |
Response: 200 JSON
POST /api/v1/codes
Makes a dynamic code with a target. The target passes the same checks as in the panel: the block list and Google Web Risk. The plan's limits apply.
| Field | Type | Values | Description |
|---|---|---|---|
| namerequired | string | up to 120 characters | The code's name, shown in the panel. |
| targetrequired | object | The target: url, vcard, wifi, links or menu (pdf only with a file uploaded in the panel). | |
| projectId | object | The project the code goes into. |
Response: 201 JSON
GET /api/v1/codes/{id}
One of the team's codes with its target and settings. The password is never returned, only whether there is one.
Response: 200 JSON
PATCH /api/v1/codes/{id}
Changes the target, name, project, look, state or options. A new target works at once, and the code's history in the panel shows that this key changed it.
| Field | Type | Values | Description |
|---|---|---|---|
| name | string | up to 120 characters | A new name. |
| target | object | A new target. | |
| projectId | object | A project, or null to take the code out of its project. | |
| appearance | object | The look: module size, error correction, colours, shape, rotation, logo. | |
| status | string | one of: active, paused | active or paused. A blocked code cannot be resumed. |
| password | object | A password the code asks for, or null to remove it. | |
| expiresAt | object | From this moment the code says it has expired; null removes the date. | |
| scanLimit | object | After this many scans the code says it has expired; null removes the limit. |
Response: 200 JSON
DELETE /api/v1/codes/{id}
Removes the code from the list. From then on its address says the code is inactive, and it will never go to anyone else.
Response: 204 No content
GET /api/v1/codes/{id}/scans
People's scans (no bots) day by day, the totals of the period, the period before and ever, and the most common countries, cities, systems, devices and browsers.
| Field | Type | Values | Description |
|---|---|---|---|
| days | string | one of: 7, 30, 90, 365; default "30" | The period in days. |
Response: 200 JSON
GET /api/v1/codes/{id}/image
The code drawn with the look stored in the panel. A code with a WebP logo is available as SVG only; for PNG and PDF upload a PNG, JPEG or SVG logo.
| Field | Type | Values | Description |
|---|---|---|---|
| format | string | one of: svg, png, pdf; default "svg" | The file format. |
| dpi | integer | 72 to 1200; default 300 | PNG resolution. |
Response: 200 A file: SVG, PNG, PDF
GET /api/v1/projects
The projects the team groups its codes into.
Response: 200 JSON
POST /api/v1/projects
Makes a project; its id goes into a code's projectId.
| Field | Type | Values | Description |
|---|---|---|---|
| namerequired | string | up to 80 characters | The project's name. |
Response: 201 JSON