For Developers
QR Code API
Generate QR codes and read scan analytics straight from your own code. The CodesQR API is a small, predictable REST interface that returns JSON, available on every CodesQR account.
Authentication
Every request is authenticated with a secret API key sent as a bearer token. Create a key from your dashboard under Settings, keep it server side, and never expose it in client code. All requests go over HTTPS to https://api.codesqr.com.
Authorization: Bearer sk_live_your_api_key
Endpoints
/v1/qr
Create a static or dynamic QR code.
/v1/qr/{id}
Retrieve a single QR code and its image URLs.
/v1/qr/{id}
Change a dynamic code's destination or title.
/v1/qr/{id}/stats
Read scan analytics for a dynamic code.
/v1/qr
List the QR codes in your account.
/v1/qr/{id}
Delete a QR code.
Create a QR code
Send a POST to /v1/qr with the type and target. Set dynamic: true to get an editable, trackable code you can update later. The response includes ready to use PNG and SVG image URLs.
Request
curl https://api.codesqr.com/v1/qr \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "url",
"target": "https://example.com/spring-sale",
"dynamic": true,
"title": "Spring Sale Poster",
"color": { "dark": "#059669", "light": "#ffffff" },
"format": "png"
}'
Response
{
"id": "qr_8fK2p1Qz",
"type": "url",
"target": "https://example.com/spring-sale",
"dynamic": true,
"short_url": "https://csqr.io/8fK2p1Qz",
"image_url": "https://cdn.codesqr.com/qr/8fK2p1Qz.png",
"svg_url": "https://cdn.codesqr.com/qr/8fK2p1Qz.svg",
"scans": 0,
"created_at": "2026-07-18T10:24:00Z"
}
Update a dynamic code
Because a dynamic QR code keeps the same printed pattern, you can point it somewhere new anytime with a PATCH. Existing printed codes keep working, no reprint required.
Request
curl -X PATCH https://api.codesqr.com/v1/qr/qr_8fK2p1Qz \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "target": "https://example.com/summer-sale" }'
Read scan stats
For dynamic codes, fetch scan analytics with a GET to /v1/qr/{id}/stats. You get totals, a daily breakdown, and a device split you can chart or export.
Request
curl https://api.codesqr.com/v1/qr/qr_8fK2p1Qz/stats \
-H "Authorization: Bearer sk_live_your_api_key"
Response
{
"id": "qr_8fK2p1Qz",
"total_scans": 1842,
"unique_scans": 1310,
"range": "last_30_days",
"by_day": [
{ "date": "2026-07-16", "scans": 74 },
{ "date": "2026-07-17", "scans": 91 },
{ "date": "2026-07-18", "scans": 63 }
],
"by_device": { "mobile": 1521, "desktop": 248, "tablet": 73 }
}
Rate limits and errors
The API returns standard HTTP status codes: 200 on success, 400 for a malformed request, 401 for a bad key, and 429 when you exceed your plan's rate limit. Error responses include a machine readable code and a human readable message. Prefer no code at all? You can create and manage everything by hand in the app, or explore all QR code types first.
Ready to build?
Create a free CodesQR account, generate an API key in Settings, and make your first QR code with a single request.
Create a free accountYour Trackable QR Code Is a Minute Away
Point a code at any link or file, track every scan, and change the destination whenever you need.
Create My Free QR Code- Free forever
- No credit card
- Setup in minutes