开发者 · API v1
集成 TopV 声誉
到你的网站、Tebex、Discord。
免费公共 API。可嵌入的 SVG 徽章。开放 CORS 的 JSON。无需密钥,无需注册,无严厉速率限制。
SVG 徽章
通过 <img> 嵌入。8 种颜色变体,与你的网站设计自动匹配。
JSON API
开放 CORS *。无需密钥。CDN 缓存 + stale-while-revalidate。
稳定
版本化端点 (/api/v1/*)。合理的速率限制,超出时返回 429 和 Retry-After。
快速开始
SVG 徽章
HTML
<a href="https://topv.gg/creators/quasar-store"> <img src="https://topv.gg/api/v1/badge/quasar-store" alt="TopV" /> </a>
带按钮的投票小部件 400×80。用于商店首页。
HTML
<a href="https://topv.gg/creators/quasar-store"> <img src="https://topv.gg/api/v1/widget/quasar-store" alt="Vote on TopV" /> </a>
JSON API
JavaScript
const res = await fetch("https://topv.gg/api/v1/creator/quasar-store");
const data = await res.json();
console.log(data.votes, data.rating, data.reviews);端点
GETSVG
/api/v1/badge/{slug}
SVG 徽章 160×32(创作者)。接受 ?color=。
GETSVG
/api/v1/badge/server/{slug}
SVG 徽章 160×32(FiveM/RedM 服务器)。
GETSVG
/api/v1/widget/{slug}
带按钮的投票小部件 400×80。用于商店首页。
GETSVG
/api/v1/widget/server/{slug}
服务器投票小部件。
GETJSON
/api/v1/creator/{slug}
完整的创作者数据:投票、评分、评论、等级、链接。
GETJSON
/api/v1/server/{slug}
完整的服务器数据。
GETJSON
/api/v1/rankings?type=creators|servers&limit=10
按投票排名前 N 名。
GETJSON
/api/v1/search?q=query&type=creators|servers|all
全文搜索(最少 2 个字符)。
徽章和小部件参数
?color=强制使用 8 种可用变体之一。如果缺失,颜色会自动匹配 TopV 个人资料的 accent。
orange
red
rose
coral
gold
violet
sky
mint
速率限制
Badge / widget SVG
每个 IP 300 请求/分钟。
JSON creator / server / search
每个 IP 60 请求/分钟。
JSON rankings
每个 IP 30 请求/分钟(join + sort,较重)。
超出时:响应 429 Too Many Requests · Retry-After: 60
版本控制
使用 /api/v1/* 保证长期兼容性。遗留端点 (/api/badge/*, /api/widget/*, /api/public/*) 仍可用但可能演变。发生breaking change时将引入新的 /api/v2 — v1 将保持不变。
