Public API reference
Read-only JSON endpoints for the TopWapi leaderboard, categories and platform statistics. Edge-cached, no key required for reasonable use.
Conventions
- All endpoints return JSON with an
okboolean as the first field. - Responses are cached at the edge. Public reads use
s-maxagebetween 30 and 600 seconds. - No authentication is required for the endpoints below. Please do not poll more than once a minute.
- Timestamps are ISO 8601 or SQLite
YYYY-MM-DD HH:MM:SSin UTC. - Set an identifying
User-Agentif you build something on top of this.
GET /api/leaderboard
The paginated toplist. Twenty websites per page by default.
| Parameter | Type | Notes |
|---|---|---|
page | integer | 1-based. Default 1. |
perPage | integer | 1–50. Default 20. |
category | string | Category slug, e.g. marketing. |
q | string | Search title, description, domain and tags. |
sort | enum | rank (default), trending, clicks, new. |
curl "https://topwapi.pages.dev/api/leaderboard?page=1&perPage=3"
{
"ok": true,
"page": 1,
"perPage": 3,
"pages": 1,
"total": 25,
"sort": "rank",
"items": [
{
"id": 1,
"rank": 1,
"title": "RankForge — SEO Audit & Keyword Lab",
"slug": "rankforge-io",
"url": "https://rankforge.io",
"domain": "rankforge.io",
"shortDescription": "Crawl any site in 40 seconds …",
"category": { "slug": "marketing", "name": "Marketing & Growth", "icon": "📈" },
"favicon": "https://www.google.com/s2/favicons?domain=rankforge.io&sz=128",
"verified": true,
"featured": true,
"uniqueClicks": 184230,
"clicks7d": 2140,
"clicks30d": 9840,
"impressions": 241900,
"score": 1397.1,
"topCountry": "United States"
}
]
}
GET /api/websites/{slug}
A single listing with its related listings.
curl "https://topwapi.pages.dev/api/websites/rankforge-io"
GET /api/categories
All categories with live site counts and click totals.
{ "ok": true, "total": 12, "items": [
{ "slug": "technology", "name": "Technology & SaaS", "icon": "⚙️",
"sites": 6, "clicks": 460000, "url": "/category/technology" }
] }
GET /api/stats
Platform counters and the daily in/out series used in the footer.
| Parameter | Type | Notes |
|---|---|---|
days | integer | 7–90. Default 30. Length of the daily series. |
{ "ok": true,
"stats": { "users": 25, "websites": 25, "totalClicks": 2440000,
"todayIn": 26640, "todayOut": 9100, "todayPageViews": 51681 },
"series": [ { "day": "2026-09-08", "visitors_in": 21044,
"visitors_out": 7003, "page_views": 40825 } ] }
GET /api/health
Deployment smoke test. Confirms the D1 binding is live and reports row counts.
{ "ok": true, "service": "TopWapi", "database": {
"bound": true, "users": 25, "websites": 25,
"categories": 12, "promoLinks": 25, "articles": 8 },
"latencyMs": 31 }
GET /api/track/click?slug=…
Records a deduplicated outbound click and returns the destination. Add
&format=json for a JSON response; without it the endpoint issues a 302 redirect.
The response includes counted, which is true only when this visit was
a new unique visitor for the day.
Attribution
If you display this data publicly, credit TopWapi with a link to topwapi.pages.dev. Bulk archival or resale of the dataset is not permitted.