Endpoints

Counter API does not have any authentication. You do not need any token, or a password to use it. The API address is https://api.counterapi.dev/v1open in new window


You can find all endpoints listed below. You can simply run the given example query to see the result.

Counter Up

You can count up with given counter name. The endpoint is https://api.counterapi.dev/v1/:namespace/:name/up.

Parameters

namerequireddescription
:namespaceyesNamespace for the counter
:nameyesCounter name

Test

curl -X GET https://api.counterapi.dev/v1/test/test/up

Counter Down

You can count down with given counter name. The endpoint is https://api.counterapi.dev/v1/:namespace/:name/down.

Parameters

namerequireddescription
:namespaceyesNamespace for the counter
:nameyesCounter name

Test

curl -X GET https://api.counterapi.dev/v1/test/test/down

Set Counter

You can set counter with given counter name and count number. The endpoint is https://api.counterapi.dev/v1/:namespace/:name/set.

Parameters

namerequireddescription
:namespaceyesNamespace for the counter
:nameyesCounter name
countyesCount number

Test

curl -X GET https://api.counterapi.dev/v1/test/test/?count=10

Counter Get

You can count get with given counter name. The endpoint is https://api.counterapi.dev/v1/:namespace/:name/.

Parameters

namerequireddescription
:namespaceyesNamespace for the counter
:nameyesCounter name

Test

curl -X GET https://api.counterapi.dev/v1/test/test

Counts List

You can get count list with given counter name. The endpoint is https://api.counterapi.dev/v1/:namespace/:name/list.

Parameters

namerequireddescription
:namespaceyesNamespace for the counter
:nameyesCounter name
group_bynoGrouping the results by given time interval, default day. Options: hour, day, week, month, year.
order_bynoOrdering the results. e.g. asc, desc.

Test

curl -X GET https://api.counterapi.dev/v1/test/test/list?group_by=day