HomeGuidesSMLLR Analytics API for Python: A Developer Guide

SMLLR Analytics API for Python: A Developer Guide

Build with Python. Learn how to pull SMLLR's QR code, campaign, and client scan analytics into your Python applications and dashboards via the reporting API.

What the API Actually Does

SMLLR's public API is a read-only reporting API, not a QR-generation API. It lets you pull scan analytics for your account, individual QR codes, campaigns, and (for agencies) clients as JSON — perfect for feeding a Python data pipeline, a Pandas notebook, or a Streamlit dashboard. Creating and editing QR codes — including changing a destination URL — is done through the SMLLR dashboard, not this API. This guide covers what the API can actually do and how to call it from Python.

Why Python Works Well Here

Whether you're running a Django web app or a simple script to sync scan data into an internal dashboard, Python's clean syntax and library ecosystem make it a solid fit for consuming the SMLLR reporting API. This guide is for the developer pulling QR, campaign, and client analytics into a Python backend or notebook.

Step 1: Authenticating Your Requests

Authentication is a single static API key, not a JWT or OAuth2 flow — there's no token refresh to manage. Generate your key from Settings → API in the SMLLR dashboard (Premium plan required); it's shown once, so copy it immediately. Send it as the x-api-key header, or as a Bearer token in the Authorization header — either works.

  • Secure Storage: Never hardcode your API key in your Python scripts — load it from an environment variable.
  • Regeneration: If a key leaks, regenerate it from Settings → API; the old key stops working instantly.
  • Rate Limit: 60 requests per minute per key, enforced per API key (not shared with other integrators).

Step 2: Pulling Account-Wide and QR-Level Analytics

The core endpoints return JSON scan analytics, paginated with a cursor for list responses. GET /summary gives account-wide totals; GET /qrs lists your QR codes (paginated); GET /qr/:id gives detailed scan analytics for one code — device breakdown, location data, and daily/hourly trends. All accept a period query param (7d, 30d, 90d, or all, defaulting to 30d).

  • GET /summary — account-wide scan totals for the selected period
  • GET /qrs — paginated list of your QR codes, with a cursor for the next page
  • GET /qr/:id — full analytics for a single QR code
  • Every list response includes built-in 'insights' (e.g. QR codes with zero lifetime scans) unless you pass `?insights=false`

Step 3: Campaign and Client Analytics

For agencies and teams running multiple campaigns or managing multiple clients, the same pattern applies at the campaign and client level — useful for building a client-facing Python dashboard without re-deriving aggregation logic yourself.

Step 4: Loading Analytics Into Pandas

Every endpoint returns a consistent { success, data } JSON envelope, which drops straight into a Pandas DataFrame — no scraping or CSV export needed. Because list endpoints (/qrs, /campaigns, /clients) are cursor-paginated, loop until pagination.hasMore is false to pull a full dataset rather than assuming everything fits on one page.

Working Within the Rate Limit

At 60 requests per minute per key, a Python script syncing a large account should paginate deliberately rather than firing requests in a tight loop — batch your calls, add a short delay between pages, and handle a 429 response by backing off rather than retrying immediately. For most dashboard-refresh use cases (pulling data every few minutes, not every few seconds), this limit is generous; if you need a higher ceiling for a high-volume integration, contact SMLLR support.

Frequently Asked Questions

Is there a Python SDK for SMLLR?

Not currently — there's no published pip-installable package. The API is a standard REST/JSON API, so the requests library (or httpx/aiohttp for async use) is all you need from Python.

Can I create or generate QR codes using the API?

No. The public API is read-only reporting — it returns scan analytics for QR codes, campaigns, and clients. Creating QR codes and editing their destination URLs is done through the SMLLR dashboard.

Is the SMLLR API free for developers?

No. API access is included only on the Premium plan (₹14,999/month) — it's not available on Free, Starter, Basic, or Pro, and there's no separate free sandbox tier. You need an active Premium subscription to generate an API key.

How do I update a QR code's destination URL using Python?

You can't through the public API — it's read-only. Destination URLs are updated from the SMLLR dashboard (Edit → Destination URL → Save).

Can I pull scan data into a Python dashboard?

Yes — that's what the API is for. GET /summary, /qr/:id, /campaign/:id, and /client/:id all return JSON scan analytics that parse directly into a Pandas DataFrame or feed a Streamlit dashboard.

What's the API rate limit?

60 requests per minute per API key, tracked per key rather than per IP, so it isn't shared with other integrations calling from the same network. Requests beyond that return a 429 response.

Related Resources