The VisitCount API allows you to programmatically access your counter data. You can use the API to retrieve counter values, increment counters, and more.
No authentication is required to use the API. However, you must know your counter ID to access your specific counter data.
GET /api/count?id=your_counter_id
Returns the current value of a counter without incrementing it.
Example response:
{
"count": 1234
}
POST /api/count?id=your_counter_id
Increments the counter by 1 and returns the new value.
Example response:
{
"count": 1235
}
GET /api/stats?id=your_counter_id
Returns detailed statistics about a counter.
Example response:
{
"id": "example_com_12345678",
"count": 1235,
"retrieved": "2023-04-15T21:25:30.000Z"
}
To display a counter on your website, add the following script tag to your HTML:
<script src="https://visitcount.vercel.app/counter.js" data-id="your_counter_id" data-style="minimal"></script>
Replace your_counter_id
with your actual counter ID, and minimal
with your preferred style.
Available styles:
minimal
- A simple, clean counterclassic
- Traditional visitor counter styledigital
- Digital display styleretro
- Retro-styled counterneon
- Neon glow effectmodern
- Modern, rounded designTo prevent abuse, the API has the following rate limits:
If you exceed these limits, the API will return a 429 Too Many Requests response.
If you have any questions or need help, please contact us at support@visitcount.com.