·

Introducing the API

Manage your analytics programmatically with our new Project and Account APIs.

Daryl
Daryl
Founder
Introducing the API

In the $1K MRR post, I mentioned the API was next. It's been one of the most requested features since we launched, and today it's here.

Visitors now has a full API that lets you access your analytics, manage your projects, and automate things however you see fit.

We have 2 APIs

We've split things into two APIs based on what you're trying to do. This separation keeps things clean. A project key can't mess with your other projects, and a user key can't pull analytics from a project it doesn't belong to.

Project API

This is for anything related to a specific project. Pull your analytics, manage members, send invites, update settings, check your realtime visitor count. You authenticate with a project key, and it's scoped to whichever project you created it for.

Account API

This is for managing your projects themselves. List them, create new ones, delete old ones. You authenticate with a user key, which has access to your entire account.

Getting started

Head to your project settings and navigate to the API page to create a project key. For a user key, head to your account settings.

Once you've got a key, pass it as a Bearer token in the Authorization header and you're good to go.

const res = await fetch("https://api.visitors.now/v1/projects", {
  headers: {
    Authorization: "Bearer vk_user_...",
  },
});

At this time, the only usage is through direct requests, we don't have any SDK's available, but all in time.

Why I'm excited about this

I touched on this briefly in a previous post, but the API opens up some genuinely interesting possibilities, especially with AI agents.

You could have an agent pull your analytics every morning, identify your best performing pages and suggest improvements. Or one that monitors traffic patterns and alerts you when something looks off. Or a script that spins up new projects automatically as part of your deployment pipeline.

These are things that weren't possible before without logging into the dashboard. Now they are.

Rate limiting

Every key gets rate limited to keep things fair. Reads are capped at 120 requests per minute, writes at 10. We return X-RateLimit-Remaining headers so you can keep track.

If you hit the limit, you'll get a 429 with a Retry-After header. Nothing crazy, just wait a moment and try again.

Documentation

We've added full documentation for every endpoint across both APIs. You can find them in the Project API and Account API sections of our docs. Not to mention, our sidebar is noticably heavier.

Closing thoughts

The API has been on my mind since before we even launched. It's one of those things that makes everything else more powerful because it lets you build on top of Visitors in ways I probably haven't even thought of yet.

If you build something cool with it, I'd love to hear about it, reach out anytime. Also, as always, feel free to reach out if you have any issues.

If you're not using Visitors yet, sign up today.

See what's driving your revenue

Start tracking your visitors today and see which sources bring in the most revenue.