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 defined by a key.
Always use a very unique key, as namespaces don't exist, making overwriting a key very easy and very likely.
All keys and their values are public. Never store any confidential contents on these servers.
To increment a counter (by +1), send a GET request to:
https://countapi.mileshilliard.com/api/v1/hit/your_key
{
"key": "your_key",
"message": "Key updated successfully",
"value": "3"
}
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
-
"get"
Endpoints
/api/v1/get/your_key
Get the current value set to the key.
/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.
/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
Hit (increase by +1) the value of your key.
/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
Not any more... someone had to ruin it for the rest of us. It's still generous, but you'll know when you hit it.