# Page Views API

> An open-source API to count visitors on any page.

An open-source API to count visitors on any page. Simple, no setup, no dashboard.

## Facts
- Website: https://page-views-api.ratneshc.com
- Pricing: open_source
- Categories: Open Source, Developer Tools
- LotsDirectory page: https://lots.directory/products/page-views-api
- Listing state: Unclaimed. We listed this product from its public website, and its owner has not claimed it yet.

## Detailed info

## What is Page Views API?

Page Views API is an open-source, serverless page counter and REST API for tracking website visits without accounts or dashboards.

## What Page Views API does

Page Views API counts visitors using a lightweight tracking script and provides a REST endpoint to display view counts. It features strict path matching, handles Single Page Application navigation, deduplicates visitors every 30 minutes via hashed identifiers, and requires no cookies or database dashboards.

## Who Page Views API is for

For creators and developers looking to track page views and count visitors on any page without dashboards or accounts.

## How Page Views API works

Developers add a script tag specifying their domain and path. When a visitor lands on that path, the script triggers an API request that hashes visitor details for Redis deduplication, incrementing the counter read via GET /api/v1/views.

## Key features

- Precision path tracking using strict pathname matching before triggering requests.
- REST API views endpoint supporting cross-origin requests to read counts and display them anywhere.
- SPA navigation compatibility hooking into history.pushState and popstate events.
- Visitor deduplication counting each visitor once every 30 minutes per site and path.
- Privacy protection storing no IP addresses, setting no cookies, and reading no local storage.
- Short-lived visitor tokens generated from a 16-character SHA-256 hash with Redis TTL expiration.

## Facts from ratneshc.com, checked 14 October 2026

- Open-source project built by Ratnesh with code available on GitHub.
- Counts visitors once every 30 minutes per site and path using Redis deduplication.
- Uses no cookies, no local storage, and stores no IP addresses.
- Provides a REST API to read view counts with cross-origin request support.

Written from Page Views API's own website ([Homepage](https://page-views-api.ratneshc.com/), [Docs](https://page-views-api.ratneshc.com/docs/getting-started)). The maker can claim this listing to edit it.

## FAQ

### Does Page Views API use cookies or local storage?
No. The tracking script sets no cookies and reads no local storage, storing zero personal data.

### How does visitor deduplication work?
The API generates a 16-character SHA-256 hash from the IP address and User-Agent, counting visitors once every 30 minutes per path.

### Can Page Views API be used with Single Page Applications?
Yes. The script listens to history.pushState and popstate events to track client-side route changes in React, Vue, and Next.js.

### Who built Page Views API?
Page Views API is an open-source project built by Ratnesh with source code available on GitHub.

---
Source: https://lots.directory/products/page-views-api · Machine-readable context by LotsDirectory.