Create a client ID and secret on the developer settings page and save the secret for later use.
Get a temporary access token.
curl --location --request POST 'https://api.pirsch.io/api/v1/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_id": "INSERT_CLIENT_ID",
"client_secret": "INSERT_CLIENT_SECRET"
}
'
Use the access token in the Authorization header to get the domain (dashboard) ID.
curl --location --request GET 'https://api.pirsch.io/api/v1/domain' \
--header 'Authorization: Bearer INSERT_ACCESS_TOKEN'
Read the visitor graphs or any other statistic you care about. Use a filter to limit the results.
curl --location --request GET 'https://api.pirsch.io/api/v1/statistics/visitor?id=INSERT_DASHBOARD_ID&from=2022-12-01&to=2022-12-09' \
--header 'Authorization: Bearer INSERT_ACCESS_TOKEN'