Get the requested page's views or unique visitors from Plausible Analytics
Find a file
2024-10-21 15:13:13 +02:00
.env.example Initial Commit 2024-10-21 15:13:13 +02:00
.gitignore Initial Commit 2024-10-21 15:13:13 +02:00
main.js Initial Commit 2024-10-21 15:13:13 +02:00
package.json Initial Commit 2024-10-21 15:13:13 +02:00
README.md Initial Commit 2024-10-21 15:13:13 +02:00
yarn.lock Initial Commit 2024-10-21 15:13:13 +02:00

plausible-pageviews-api

Get the requested page's views or unique visitors from Plausible Analytics.

Configuration in .env

PORT=3000 # the api port
METRICS_PORT=9100 # the port on which prometheus metrics are hosted on, endpoint: /metrics
PLAUSIBLE_DOMAIN=plausible.io # the plausible instance domain
PLAUSIBLE_API_KEY="api_key_goes_here" # your plausible API key
ALLOWED_ORIGINS="https://example.com" # allowed CORS origins
RATE_LIMIT_MINUTES=15 # the amount of time in minutes to rate limit
RATE_LIMIT_REQUESTS=100 # amount of max. requests

Run the API

$ yarn install
$ yarn start