API access and tokens

The Pageviews API lets you programmatically access your analytics data. API access is available on the Enterprise plan.

Creating an API token

  1. Go to Account Settings → API Access.
  2. Click Create Token.
  3. Give your token a descriptive name (e.g., "Dashboard Integration" or "Data Pipeline").
  4. Copy the token immediately — it will only be shown once.

{screenshot: API access page with token list}

Using your token

Include your API token in the Authorization header of your API requests:

Authorization: Bearer your-api-token-here

Example request

curl -H "Authorization: Bearer your-api-token-here" https://pageviews.ai/api/v1/sites

Managing tokens

On the API Access page, you can see all your active tokens with their creation dates. You can delete any token to immediately revoke its access.

Security best practices

  • Never share your API token or commit it to version control.
  • Use environment variables to store tokens in your applications.
  • Create separate tokens for different integrations so you can revoke access granularly.
  • Rotate tokens periodically — delete old tokens and create new ones.
  • If a token is compromised, delete it immediately from the API Access page.