Skip to content
CountJar
Docs Pricing The counter API for developers A hit counter for any website A view counter badge for your GitHub README An embeddable like button A yes/no poll you can embed anywhere Five-star ratings for any page Start free

Count anything.
Every number gets its own URL.

CountJar is a hosted counter API with drop-in widgets. Hit a URL and get a number back. Use it for page views, downloads, sign-ups, likes, votes or anything else you want to tally.

Free for 5 counters. Sign in with a code sent to your phone.

demo / test-counter

      

This is a real public counter. Everyone visiting this page shares it.

Drop a counter into any page

One script tag and a div. Widgets render in their own Shadow DOM, so your site's CSS can't break them and theirs can't break yours.

View counter

Counts each page load, or each visitor once a day.

<div class="countjar" data-workspace="demo" data-counter="test-counter" data-readonly data-label="views"></div>

Like button

One like per visitor. The heart pops when clicked.

<div class="countjar" data-workspace="demo" data-counter="likes" data-type="like"></div>

Yes/no poll

Ask a question and show live results after voting.

<div class="countjar" data-workspace="demo" data-counter="helpful" data-type="poll" data-question="Was this page helpful?"></div>

Star rating

1 to 5 stars with the live average and vote count.

<div class="countjar" data-workspace="demo" data-counter="rating" data-type="rating"></div>

Then load the script once per page: <script src="https://countjar.vercel.app/embed.js" async></script>

An API you can learn in a minute

Every counter lives at /api/v2/<workspace>/<counter>. Add an action to change it.

/up
Add one, or ?by=n with a token
/down
Subtract one
/set?value=n
Set an exact value
/reset
Back to zero
/stats
Totals, today, last 24 hours and 7 days
/history?range=7d
Hourly or daily series, JSON or CSV
?window=24h
Count within a time window
# public counter: no token needed
curl https://countjar.vercel.app/api/v2/acme/visits/up

# private counter: send a workspace token
curl -H "Authorization: Bearer cj_..." \
     "https://countjar.vercel.app/api/v2/acme/signups/up?by=5&plan=pro"

{"name":"signups","count":1285,"counted":true,...}
const res = await fetch(
  "https://countjar.vercel.app/api/v2/acme/visits/up"
);
const { count } = await res.json();
document.querySelector("#views").textContent = count;
import requests

r = requests.post(
    "https://countjar.vercel.app/api/v2/acme/builds/up",
    headers={"Authorization": "Bearer cj_..."},
)
print(r.json()["count"])
![profile views](https://countjar.vercel.app/badge/acme/profile.svg?style=flat&color=amber)
flat badge style social badge style big badge style

What comes in the jar

Private counters and scoped tokens

Keep a counter private and give each app a token that can only read, only write, or also manage counters. Tokens are shown once and stored hashed.

Visitor details

See where visits come from and what they used: country, city, device, browser and OS. Count every hit, or each visitor once a day or once ever.

Milestone alerts

Get a signed webhook or a text message when a counter passes 1,000, 10,000 or any number you choose.

History and exports

Hourly and daily charts for 24 hours, 7 days and 30 days. Download events or history as CSV or JSON.

Steps, bounds and starting values

Increment by 5, never drop below 0, cap at 100 seats, or start at 42,000 to carry over an old total.

Badges and a tracking pixel

SVG badges for READMEs and Notion, plus a 1×1 pixel for emails and conversion pages. Extra query parameters are stored with each event.

Fast and predictable limits

600 requests a minute per path, with X-RateLimit headers and Retry-After when you go over.

Workspaces and teammates

Group counters into workspaces and invite teammates by phone number.

Free, with room to grow

Sign in with your phone number and start counting in under a minute. No card, no trial clock.

Create a free account
  • 5
    counters
  • 10,000
    counts a day
  • 3
    workspaces
  • 600
    requests a minute

Questions

Is CountJar free?

Yes. Every account gets 5 counters and 10,000 counts per day at no cost.

How do I sign up?

Enter your mobile number and type in the 6-digit code we text you. There is no password to remember.

Can I call the API from the browser?

Yes. The API sends Access-Control-Allow-Origin: *, so fetch() works from any website for public counters.

What do you record about visitors?

Each visit records its country, city, device, browser, OS, language and IP address, so you can see who your visitors are. Only the workspace owner sees IP addresses, and raw events are deleted after 90 days.

What happens when I hit a limit?

The API answers 429 with a clear error code and a Retry-After header. Daily limits reset at midnight UTC.