This API can be used to get total pageviews
and visitors
data from the Plausible Stats API safely at client side.
Don't forget to set API Key (PLAUSIBLE_TOKEN
) and Plausible domain (PLAUSIBLE_DOMAIN
, if you're using self-hosted version) in environment settings.
You can use this API in your client side:
GET /info?site=SITE_ID
and it will return the following result in JSON format:
{
"pageviews": 100000,
"visitors": 1000
}
Vercel Plausible Stats API © Baoshuo, Released under the MIT License.
Authored and maintained by Baoshuo with help from contributors (list).
Personal Website · Blog · GitHub @renbaoshuo · Twitter @renbaoshuo