Counting made effortless.
And it's free.

Track monitors, blogs, hits, and more! No Signup, No Keys. Just simple, reliable counting.

---

Total Requests

---

Active Keys

---

SLA Uptime

Introduction

CountAPI is a spin-off of the beloved OG countapi.xyz. Unfortunately, the service is no longer available to the public as a free API due to widely unknown reasons. This service has been created as a very simple alternative to countapi.xyz in hopes of getting some users back on their feet again.

Although this API is a slightly more limited version than the original, it serves a very similar purpose, and I hope it will fulfill the needs of most users looking for something similar. If not, please feel free to email me directly at [email protected] and I would be happy to talk! Until the massive traffic explosion I am totally expecting, be satisfied with what you've got. It is free after all!

By the way, this project is open source! Feel free to check it out on GitHub.

TL;DR

Each "counter" is simply defined by a unique key. No registration, no API keys, no headers required.

Since namespaces don't exist, use a very unique key (e.g., mysite_homepage_visits_2026) to avoid overwriting someone else's counter.

Warning: All keys and their values are public. Never store any confidential contents.

To increment a counter by +1, simply visit or fetch this URL:

https://countapi.mileshilliard.com/api/v1/hit/your_unique_key

{
  "key": "your_unique_key",
  "message": "Key updated successfully",
  "value": "3"
}

Quick Javascript Example:

fetch('https://countapi.mileshilliard.com/api/v1/hit/mysite_visits')
  .then(response => response.json())
  .then(data => console.log('This page has ' + data.value + ' visits!'));

Overview

This API is hosted similarly to the OG countapi. The high-level overview can be seen below.

  • Python Backend (serverless)
    • "get"
      • Redis Backend Contacted
    • "set"
      • Redis Backend Contacted

Endpoints

/api/v1/get/your_key

Get the current value of the key without increasing it. Great for just displaying the current count.

/api/v1/get/your_key - 200
{ "key": "your_key", "message": "Key requested successfully", "value": "3" }
/api/v1/get/your_key - 404
{ "error": "Key not found" }

/api/v1/set/your_key

Set the value of the key to a specific number using the ?value= query parameter. Useful for resetting counters or syncing them with another database.

/api/v1/set/your_key?value=100 - 200
{ "key": "your_key", "message": "Key set successfully", "old_value": "4", "value": "100" }
/api/v1/set/your_key - 400
{ "error": "No value provided" }

/api/v1/hit/your_key

Increase the value of your key by exactly +1. This is the most common endpoint for tracking page views, clicks, or events.

/api/v1/hit/your_key - 200
{ "key": "your_key", "message": "Key updated successfully", "value": "101" }
/api/v1/hit/your_key - 400
{ "error": "No value provided" }

/api/v1/status

Get the current status of the API.

/api/v1/status - 200
{ "message": "API is running", "uptime": "0:00:00" }

/health

General ping-able endpoint. Good for monitoring uptime.

/health - 200
{ "message": "API is healthy" }
/health - 500
N/A

FAQ

This API is designed to provide a simple and free way to keep track of counts using unique keys.

It's as simple as pinging an endpoint! You can use Javascript's fetch() inside a script tag, or even embed it as a tracking pixel by putting the URL in an image source like <img src="https://countapi.mileshilliard.com/api/v1/hit/my_tracker" style="display:none;" />.

No, there is no rate limiting. Someone ruined it for everybody else, so yes there is ratelimiting. It is extremely generous though.

No. Keys do not expire and they are publicly viewable by anyone who knows the key name. If you want to "delete" one, just stop using it and create a brand new, unique key instead!

Shoot me an email before you try to... if you wouldn't mind.