Skip to content

renbaoshuo/vercel-plausible-stats-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vercel Plausible Stats API

What is this?

This API can be used to get total pageviews and visitors data from the Plausible Stats API safely at client side.

Deploy

Deploy with Vercel

Don't forget to set API Key (PLAUSIBLE_TOKEN) and Plausible domain (PLAUSIBLE_DOMAIN, if you're using self-hosted version) in environment settings.

Usage

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
}

Author

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