Skip to content
1codigoqr

QR codes in your app, website or Django project

A REST API, drop-in web components, an iframe and a Django app you can install. All free, all without tracking.

1. An image, no key needed

Static codes render on the fly. Nothing is stored. Use POST with a JSON body for content you would rather keep out of URLs, such as WiFi passwords.

<img src="https://1codigoqr.com/api/v1/render?data=https%3A%2F%2Fexample.com&format=svg&dots=rounded"
     alt="QR code for example.com" width="200" height="200">

Parameters: data, format (svg, png, jpg, pdf), size, fg, bg, fg2, gradient, dots (square, rounded, dots, classy), eyes (square, rounded, circle), ec (L, M, Q, H), margin, frame (none, label, box), label, transparent, download.

2. Web components

One script, under 7 KB, no dependencies. Add a publishable key (qrp_…) to lock requests to your websites and raise the limits.

<script type="module" src="https://1codigoqr.com/static/qrcore/js/qr-elements.a27e7aaf0e9c.js"></script>

<qr-code data="https://example.com" size="200" dots="rounded"></qr-code>
<qr-generator></qr-generator>

3. An iframe

<iframe src="https://1codigoqr.com/embed/generator/" title="QR code generator"
        width="420" height="560" loading="lazy" style="border:0"></iframe>

4. The REST API

Create dynamic codes, change their destination and read anonymous insights. Use a secret key (qrk_…) from your server only.

curl -X POST https://1codigoqr.com/api/v1/codes/ \
  -H "Authorization: Bearer qrk_…" -H "Content-Type: application/json" \
  -H 'Idempotency-Key: "8e03978e-40d5-43e8-bc93-6894a57f9324"' \
  -d '{"name": "Menu", "type": "url", "mode": "dynamic",
       "content": {"url": "https://example.com/menu"},
       "design": {"dots": "rounded", "fg": "#0f766e"}}'
  • Safe retries. Send a new Idempotency-Key with every POST or PATCH. If the network fails, retry with the same key: you get the first answer again, marked Idempotent-Replayed, instead of a second code.
  • Pages. Lists come newest first, 50 rows at a time (up to 100 with ?limit=). Follow next until it is null; codes created meanwhile never make you miss or repeat one. This replaces the count field and ?page= numbers of API 1.0: a request with ?page= now gets a 400 error.
  • Limits you can see. Every answer says how many requests are left in the RateLimit headers. When you hit the limit, Retry-After says how many seconds to wait.
  • Clear errors. Errors are JSON with a stable code for your program and a detail for people.
GET /api/v1/codes/?limit=50
RateLimit-Policy: "key";q=600;w=60
RateLimit: "key";r=599;t=42

{"next": "https://1codigoqr.com/api/v1/codes/?cursor=…&limit=50", "previous": null, "results": […]}

{"code": "idempotency_key_reused", "detail": "This Idempotency-Key was already used for a different request. …"}

Webhooks: qr.created, qr.updated, qr.deleted, qr.scan_milestone (at 100, 1,000 and up to 1,000,000 scans) and a daily qr.scanned summary, signed following the Standard Webhooks specification.

5. Let people connect their account (OAuth 2.0)

Building an app for other people? Use OAuth instead of asking them for an API key. They sign in on 1codigoqr, see what your app asks for, and pick the one workspace it may use. Your app can then do only what their role there allows, and they can revoke it at any time.

  1. Register your app in the workspace settings, under OAuth apps (admins only). Note the client ID, and the secret if your app runs on a server.
  2. Make a PKCE code verifier and its S256 challenge, then send the person to the authorization endpoint:
# a random verifier, 43–128 characters, kept by your app
CODE_VERIFIER=$(openssl rand -base64 48 | tr '+/' '-_' | tr -d '=\n')
CODE_CHALLENGE=$(printf %s "$CODE_VERIFIER" | openssl dgst -binary -sha256 | openssl base64 | tr '+/' '-_' | tr -d '=\n')

https://1codigoqr.com/oauth/authorize?response_type=code
  &client_id=YOUR_CLIENT_ID
  &redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback
  &scope=codes%3Aread%20codes%3Awrite
  &state=RANDOM_STATE
  &code_challenge=$CODE_CHALLENGE&code_challenge_method=S256
  1. They come back to your redirect address with ?code=…&state=…. Check the state, then swap the code for tokens (within a minute):
curl -X POST https://1codigoqr.com/oauth/token \
  -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
  -d grant_type=authorization_code -d code=THE_CODE \
  -d redirect_uri=https://app.example.com/callback \
  -d code_verifier=$CODE_VERIFIER

{"access_token": "…", "token_type": "Bearer", "expires_in": 3600,
 "refresh_token": "…", "scope": "codes:read codes:write workspace:9b2f…"}
  1. Call the API with the access token. It acts on the workspace the person picked (the workspace:… scope), as them:
curl https://1codigoqr.com/api/v1/codes/ -H "Authorization: Bearer ACCESS_TOKEN"

Public apps (in a browser, on a phone or desktop) have no secret: send client_id in the body instead of -u. Access tokens last an hour. Refresh with grant_type=refresh_token; every refresh gives a new refresh token, and one unused for 90 days expires. Scopes: codes:read, codes:write, insights:read, render, and openid, email and profile for sign-in. Discovery: /.well-known/openid-configuration

6. In your own Django project

The engine behind 1codigoqr is an open-source Django app (MIT). Install it, add one line to your URLs and you have the generator, dynamic codes, insights and the API.

pip install "django-1codigoqr-qr[s3]"

# settings.py
INSTALLED_APPS += ["rest_framework", "drf_spectacular", "qrcore"]
QRCORE = {"SHORT_URL_BASE": "https://example.com/qr/"}

# urls.py
path("qr/", include("qrcore.urls")),

# any template
{% load qrcore %}{% qr_code "https://example.com" size=200 style="rounded" %}