Blog
Use cases

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

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.

Start for free See how it works

Related

Web Analytics for Agencies Managing Many Client Sites How agencies track dozens of client sites from one dashboard, without cookie banners or per-site pricing. Analytics for Indie Hackers Running Many Side Projects Track every side project from one dashboard with no per-site fees, no cookies and a clean at-a-glance view. Analytics for AI Agents That Read Your Traffic Give an AI agent secure, read access to your web analytics through a native MCP server, no API keys to paste.