use-rest-api
Provides access to the Torrust Tracker REST API for querying and testing.
Install
mkdir -p .claude/skills/use-rest-api && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16604" && unzip -o skill.zip -d .claude/skills/use-rest-api && rm skill.zipInstalls to .claude/skills/use-rest-api
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use the Torrust Tracker REST API. Covers authentication, all endpoints (stats, metrics, torrents, auth keys, whitelist), and making announce/scrape requests to verify API behaviour. Triggers on "use API", "test API", "call REST API", "query API", "API endpoint", "curl tracker", "tracker client", "announce request", or "verify API".Key capabilities
- →Authenticate with the Torrust Tracker REST API using header or query parameter methods
- →Query health check, stats, and metrics endpoints
- →Manage auth keys (POST, DELETE, GET reload)
- →Manage whitelist entries (POST, DELETE, GET reload)
- →Retrieve torrent information (GET single torrent, GET all torrents)
- →Make UDP and HTTP announce/scrape requests using `tracker_client`
How it works
This skill enables authenticated interaction with the Torrust Tracker REST API by providing methods for authentication, detailing available endpoints for stats, metrics, auth keys, whitelist, and torrents, and demonstrating how to make announce/scrape requests using the `tracker_client` binary. It also outlines a verif
Inputs & outputs
When to use use-rest-api
- →Querying tracker statistics
- →Testing API endpoint behavior
- →Sending announce/scrape requests
- →Managing API access tokens
About this skill
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
curl "http://localhost:1212/api/v1/stats?token=MyAccessToken"
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
cargo run -p torrust-tracker-client --bin tracker_client -- udp announce udp://localhost:6969/announce 0123456789abcdef0123456789abcdef01234567
HTTP Announce
cargo run -p torrust-tracker-client --bin tracker_client -- http announce http://localhost:7070/announce 0123456789abcdef0123456789abcdef01234567
Scrape
cargo run -p torrust-tracker-client --bin tracker_client -- udp scrape udp://localhost:6969/announce 0123456789abcdef0123456789abcdef01234567
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
When not to use it
- →When the tracker is not running or the REST API is not enabled
- →When the task does not involve interacting with the Torrust Tracker REST API
- →When the task requires permissions beyond those granted by the configured access tokens
Prerequisites
Limitations
- →The skill requires a running tracker with the REST API enabled
- →Authentication relies on access tokens defined in the TOML config file
- →The skill's examples use `http://localhost:1212` as the default base URL
How it compares
This skill provides a complete guide to interacting with the Torrust Tracker REST API, including authentication, endpoint details, and client usage examples, offering a structured approach compared to exploring the API without specific
Compared to similar skills
use-rest-api side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| use-rest-api (this skill) | 0 | 1mo | Review | Intermediate |
| add-api-version | 1 | 6mo | Review | Advanced |
| solana-dev | 0 | 4mo | Review | Advanced |
| mcp | 0 | 7mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by torrust
View all by torrust →You might also like
add-api-version
oxidecomputer
Add a new version to a Dropshot HTTP API. Use when the user wants to make versioned changes to a Dropshot-managed HTTP API, such as adding, making changes to, or removing an API endpoint.
solana-dev
mashharuki
Use when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "deploy to devnet", or "explain Solana concepts" (rent, accounts, PDAs, CPIs, etc.). End-to-end Solana development playbook covering
mcp
Piebald-AI
Guide for working with Splitrail's MCP server. Use when adding tools, resources, or modifying the MCP interface.
solana-dev
solanabr
Unified skill hub for Solana development. Routes to external submodule skills (solana-foundation, sendai, solana-game, trailofbits, cloudflare, qedgen, colosseum) and local skills. Progressive disclosure — read only what you need.
azure-eventhub-rust
RJsolucoes
|
tauri
EpicenterHQ
Tauri path handling, cross-platform file operations, and API usage. Use when working with file paths in Tauri frontend code, accessing filesystem APIs, or handling platform differences in desktop apps.