Introduction
This documentation provides an overview of the available endpoints in the API. The API requires authentication through Sanctum and allows to access the API of a specific site only if the site has an active subscription.
Authentication
The API uses Bearer Token authentication. To authenticate you need to generate an API token for your user. This can be done by clicking on your user icon in the top right corner and selecting "API". You can then generate a new token by clicking on the "Create" button. The token will be displayed in the table. You can then use this token to authenticate with the API by adding it to the Authorization header of your request. Remember to save the token somewhere safe, as it will not be displayed again.
All requests can be done to a single site, substituting in the path its unique tracking {siteId}: you can find it in the "Tracking Options" page (e.g.: example.com/EXMPL1).
Example API Call
curl --location 'https://publytics.net/api/site/{siteId}/visitors/hostname' \
--header 'Authorization: Bearer {token}'