Skip to main content
SnapCount logoSnapCount

Public read API

Read counters, current totals, and recent count events with an organization API key. The API is read-only.

Updated

On this page
Endpoints at a glance
MethodEndpointReturns
GET/api/v1/countersEvery counter and its total
GET/api/v1/counters/:counterIdOne counter and its total
GET/api/v1/counters/:counterId/historyRecent count events, newest first

Authentication

Every request goes to https://api.snapcount.app and carries an organization API key as a Bearer token.

Request header
Authorization: Bearer sc_live_...
  • The public API comes with Pro and Enterprise. On any other plan it returns 403.
  • Owners and admins create and revoke keys in Settings, Developers. An organization can hold up to 10 keys.
  • A key reads only its own organization. Give each integration its own key so you can revoke one without breaking the others.

List counters

GET/api/v1/counters

Returns every counter in the organization with its current total, sorted by name.

curl https://api.snapcount.app/api/v1/counters \
  -H "Authorization: Bearer sc_live_..."
Response 200
{
  "counters": [
    {
      "id": "cm1gatea0001",
      "name": "Gate A",
      "count": 187,
      "incrementStep": 1,
      "decrementStep": 1,
      "mode": "both",
      "organizationId": "cm1org0001",
      "groupId": null,
      "goalTarget": null,
      "locked": false,
      "version": 212,
      "lastEventId": 5812,
      "createdAt": "2026-09-20T08:00:00.000Z",
      "updatedAt": "2026-09-26T18:42:10.000Z"
    }
  ]
}

Counter fields

Counter fields
FieldTypeMeaning
countintegerThe current total.
incrementStepintegerHow much one tap on plus adds.
decrementStepintegerHow much one tap on minus takes away.
modestringboth, increment-only, or decrement-only.
groupIdstring or nullThe counter group it belongs to, if any.
goalTargetnumber or nullThe goal set on the counter, if any.
lockedbooleanTrue while an admin has locked the counter.
lastEventIdintegerId of the newest count event. It only goes up, so compare it to spot a change.
updatedAtdate-timeWhen the counter last changed.

Get a counter

GET/api/v1/counters/:counterId

Returns one counter in the same shape as an item in the list. A counter that does not exist in the key's organization returns 404.

cURL
curl https://api.snapcount.app/api/v1/counters/cm1gatea0001 \
  -H "Authorization: Bearer sc_live_..."

Counter history

GET/api/v1/counters/:counterId/history

Returns recent count events, newest first. Rows that only changed a counter's settings (update) are left out.

Query parameters
ParameterDefaultMeaning
limit100Events to return, from 1 to 500.
beforeEventIdnoneOnly events with a lastEventId lower than this. Use it to read the next page.
cURL
curl "https://api.snapcount.app/api/v1/counters/cm1gatea0001/history?limit=50" \
  -H "Authorization: Bearer sc_live_..."
Response 200
{
  "counterId": "cm1gatea0001",
  "counterName": "Gate A",
  "events": [
    {
      "id": "cm1evt5812",
      "counterId": "cm1gatea0001",
      "eventType": "increment",
      "count": 187,
      "previousCount": 186,
      "delta": 1,
      "lastEventId": 5812,
      "metadata": null,
      "createdAt": "2026-09-26T18:42:10.000Z"
    }
  ]
}

Read the next page

Pass the lastEventId of the oldest event you received as beforeEventId. An empty events list means you have reached the start.

cURL
curl "https://api.snapcount.app/api/v1/counters/cm1gatea0001/history?limit=50&beforeEventId=5763" \
  -H "Authorization: Bearer sc_live_..."

Rate limits

Limits count per API key, in two windows. Responses carry standard RateLimit headers so you can slow down before you hit them.

Rate limits per API key
PlanPer minutePer hour
Pro601,000
Enterprise30010,000
Polling for changes? A webhook reaches you the moment a counter moves and does not count against these limits. Set up webhooks.

Errors

Errors come back as JSON with an error message, and a machine-readable code where one applies.

Error responses
StatusCodeWhen
401noneThe key is missing, revoked, or wrong.
403PLAN_REQUIREDThe organization is not on Pro or Enterprise.
404noneThe counter is not in this organization.
429RATE_LIMITEDThe key is over its per-minute or per-hour limit.
{
  "error": "The public API requires a Pro plan",
  "code": "PLAN_REQUIRED",
  "requiredPlan": "organization"
}

Was this page helpful?

Ready to connect SnapCount?

Create an API key or a webhook endpoint in Settings. The public API and webhooks come with Pro and Enterprise.