Web Analytics With a REST API
Plenty of analytics tools keep your numbers locked behind their dashboard. If you want to put a live counter on your site, feed a report or build on top of your data, you need a real API. YourTraffic gives you one.
One key, one endpoint
Every project has an API key, shown under Settings in the dashboard. Pass it as a Bearer token to the stats endpoint and you get visitors, pageviews, top pages, sources and countries back as clean JSON. No scraping and no export files.
Getting started
Copy your project key, send a request to the stats endpoint with the range you want and read the response. Wiring it into a script or a cron job takes minutes, and there is a full guide at llms.txt written to be read by both people and machines.
What you can build
- A live visitor counter or a public stats page on your own site.
- Weekly reports pulled straight from the source.
- Internal dashboards that combine traffic with your other metrics.
- Alerts that fire when traffic spikes or drops.
Agents too
If your workflow involves AI agents, the native MCP server sits on top of the same data. An agent signs in through OAuth and reads your traffic directly, with no API key to paste anywhere.
Self-host YourTraffic for free or use the cloud. Add a site, grab your key and start pulling stats within minutes.