# Cloud Counter API

> Cloud Counter stores and updates persistent numeric counters by ID without needing a database. It tracks increments, decrements, and custom values while returning timestamps and number properties like parity and prime status.

**Endpoint:** `GET https://api.apiverve.com/v1/counter`  
**Category:** Data Processing  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/counter

## Overview

A cloud counter API that keeps a named number for you between requests, with no database to run. Pick an ID, call it with up, down, set or get, and the current value comes back with timestamps for when it was created, last read and last changed. It works as a persistent counter for page views, button clicks, download tallies, queue numbers or anything else you would otherwise store a single integer for.

Because the counter lives behind a simple GET request, it fits static sites, serverless functions, no-code automations, IoT devices and quick prototypes. Each response also describes the number: spelled out in words and as an ordinal, its digit count, and whether it is even, negative, zero or prime.

Counters are scoped to your API key, and you can list or delete them at any time. The Free plan increments and decrements in steps of one and can set any value. Paid plans let up and down move the counter by any amount in one call, and higher plans allow more counters per key.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/counter?id=test_counter" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The ID of the counter (e.g., test_counter) |

## Response fields

- `created` — string · ISO timestamp of when the counter was first created
- `id` — string · The identifier of the counter
- `lastAction` — string · The most recent action performed on the counter (e.g., get, up, down, set)
- `lastRead` — string · ISO timestamp of when the counter was most recently queried
- `lastUpdated` — string · ISO timestamp of when the counter's value was last changed
- `numberOfDigits` — number · The number of digits in the counter's current value, not counting a negative sign
- `ordinal` — string · The counter's current value spelled out as an ordinal word (e.g., "zeroth")
- `value` — number · The counter's current numeric value
- `words` — string · The counter's current value spelled out in words (e.g., "zero")
- `isEven` — boolean · Whether the counter value is even
- `isNegative` — boolean · Whether the counter value is negative
- `isZero` — boolean · Whether the counter value is zero
- `isPrime` — boolean · Whether the counter value is a prime number

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "created": "2024-04-26T22:09:46.000Z",
    "id": "test_counter",
    "lastAction": "get",
    "lastRead": "2025-12-16T22:21:45.000Z",
    "lastUpdated": "2024-04-26T22:09:46.000Z",
    "numberOfDigits": 1,
    "ordinal": "zeroth",
    "value": 0,
    "words": "zero",
    "isEven": true,
    "isNegative": false,
    "isZero": true,
    "isPrime": false
  }
}
```

## Use cases

- **Article View Counts** — Increment a page tally each time a reader loads a blog post, returning the fresh total without querying a local database.
- **Feature Usage Quotas** — To enforce monthly limits, SaaS backends increase a user action counter and check whether the total crosses allowed thresholds.
- **Live Score Tracking** — Gaming servers adjust player points up or down during matches while fetching parity and formatted word representations.
- **Inventory Stock Adjustments** — When shoppers complete checkout, decrement item tallies and inspect the remaining balance without maintaining dedicated database tables.

## SDKs

- **npm** — `npm install @apiverve/counter` (https://www.npmjs.com/package/@apiverve/counter)
- **PyPI** — `pip install apiverve-counter` (https://pypi.org/project/apiverve-counter/)
- **NuGet** — `dotnet add package APIVerve.API.CloudCounter` (https://www.nuget.org/packages/APIVerve.API.CloudCounter)
- **Source** — https://github.com/apiverve/counter-api

## More

- Full reference: https://docs.apiverve.com/ref/counter
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
