use-rest-api
БесплатноБез исполняемых скриптовНе проверенCall the tracker REST API: authentication, stats, metrics, torrents, auth keys and whitelist. Use when querying or testing the API, for example with curl.
от torrust★ 539 звёзд на GitHubОб этом скилле
Use REST API
Prerequisites
A running tracker with the REST API enabled. The default development config starts the API on port 1212:
cargo run
Skill Links
This skill depends on these artifacts. If any of them change, review this skill.
share/default/config/tracker.development.sqlite3.tomlpackages/axum-rest-api-server/src/v1/middlewares/auth.rspackages/axum-rest-api-server/src/routes.rspackages/axum-rest-api-server/src/v1/routes.rs
Use the marker skill-link: use-rest-api in affected artifacts.
Authentication
All API endpoints (except /api/health_check) require an access token.
Header Method (preferred)
curl -H "Authorization: Bearer MyAccessToken" http://localhost:1212/api/v1/stats
Query Parameter Method (accepted, not recommended)
The server still accepts the token as a ?token= query parameter, but a URL, with its query, is
written to proxy, browser and server logs. Send the header instead: it keeps the token out of the
URL. That is not every log (a proxy or server set to log request headers still records it), and
it does not protect the token in transit, which needs HTTPS. Do not write the query form in
examples (see the handle-secrets skill).
Neither form keeps a token out of your shell history: a token typed on a command line is saved
there, in a header as much as in a URL. For a real token, read it from a file or an environment
variable inside the command (for example -H "Authorization: Bearer $(cat token-file)"), as the
examples here use a placeholder only.
Configuration
Tokens are defined in the TOML config file under [http_api.access_tokens]:
[http_api.access_tokens]
admin = "MyAccessToken"
Every token in the map has identical permissions — the label (admin) is just a human-readable name.
Endpoints
All endpoints use http://localhost:1212 as base (default dev config).
Health Check
| Method | Endpoint | Auth |
|---|---|---|
| GET | /api/health_check |
❌ No |
curl -s http://localhost:1212/api/health_check
Stats
| Method | Endpoint | Auth |
|---|---|---|
| GET | /api/v1/stats |
✅ Yes |
| GET | /api/v1/metrics |
✅ Yes |
curl -s http://localhost:1212/api/v1/stats -H "Authorization: Bearer MyAccessToken"
curl -s http://localhost:1212/api/v1/metrics -H "Authorization: Bearer MyAccessToken"
Auth Keys
| Method | Endpoint | Auth |
|---|---|---|
| POST | /api/v1/key/{seconds_valid_or_key} |
✅ Yes |
| DELETE | /api/v1/key/{seconds_valid_or_key} |
✅ Yes |
| GET | /api/v1/keys/reload |
✅ Yes |
| POST | /api/v1/keys |
✅ Yes |
Whitelist
| Method | Endpoint | Auth |
|---|---|---|
| POST | /api/v1/whitelist/{info_hash} |
✅ Yes |
| DELETE | /api/v1/whitelist/{info_hash} |
✅ Yes |
| GET | /api/v1/whitelist/reload |
✅ Yes |
Torrents
| Method | Endpoint | Auth |
|---|---|---|
| GET | /api/v1/torrent/{info_hash} |
✅ Yes |
| GET | /api/v1/torrents |
✅ Yes |
Making Announce Requests with the Tracker Client
The tracker_client binary can make BitTorrent announce requests to verify the tracker is working.
UDP Announce
tracker_clientwrites JSON to stdout and refuses to run when stdout is a terminal (exit 2, atty_refusalrecord on stderr), so the commands below pipe the output tojq. Pipe or redirect it the same way in your own commands.
cargo run -p torrust-tracker-client --bin tracker_client -- udp announce udp://localhost:6969/announce 0123456789abcdef0123456789abcdef01234567 | jq .
HTTP Announce
cargo run -p torrust-tracker-client --bin tracker_client -- http announce http://localhost:7070/announce 0123456789abcdef0123456789abcdef01234567 | jq .
Scrape
cargo run -p torrust-tracker-client --bin tracker_client -- udp scrape udp://localhost:6969/announce 0123456789abcdef0123456789abcdef01234567 | jq .
Output defaults to JSON. Use --format text for human-readable output.
Verification Workflow
After making an announce request, verify the API reflects the activity:
Check stats changed:
curl -s http://localhost:1212/api/v1/stats -H "Authorization: Bearer MyAccessToken"Expect
torrentsandseedersto increase.Check metrics changed:
curl -s http://localhost:1212/api/v1/metrics -H "Authorization: Bearer MyAccessToken"Expect protocol-specific counters to increase.
Check tracker console logs show the request was received:
active_peers_total=1 active_torrents_total=1
Установить use-rest-api в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл use-rest-api?
Call the tracker REST API: authentication, stats, metrics, torrents, auth keys and whitelist. Use when querying or testing the API, for example with curl.
Как установить скилл use-rest-api?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл use-rest-api запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic