Introduction
CountAPI is a spin-off of the beloved OG countapi. 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 version of CountAPI 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 miles@mileshilliard.com 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!
Disclaimer: This service is in no way affiliated with CountAPI.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 and 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"
}
FAQ
What is the purpose of this API?
This API is designed to provide a simple and free way to keep track of counts using unique keys.
How do I use this API?
Ping an endpoint.
Rate limiting?
There is no rate limiting on this API.
Can I delete a key?
No. The key will be deleted by itself after it expires due to inactivity.
You can always just create a new one.
Will I break the API?
Depends on what you are doing, but I hope not. You can safely make requests at a high rate. If you do please contact me.