Status: [UNTESTED] Endpoints found: http://localhost:8000/v1/summary?limit=1 http://localhost:8000/v1/details?limit=1&search=moria&fields=nickname,fingerprint http://localhost:8000/v1/bandwidth?limit=1&search=moria http://localhost:8000/v1/weights?limit=1&search=moria http://localhost:8000/v1/clients?limit=1 Source: https://github.com/anoni-net/onionoo-fastapi # onionoo-fastapi FastAPI-based **semantic/OpenAPI proxy** for the Tor **Onionoo** API. This is the service behind the anoni.net community's [Tor relay lookup for AI assistants](https://anoni.net/en/projects/onionoo-mcp/) (onionoo MCP; 正體中文:[AI 助理的 Tor 節點查詢](https://anoni.net/projects/onionoo-mcp/)), which lets journalists and civil-society groups ask an AI assistant about Tor relays in plain language. onionoo MCP is the code name; readers know it by those names. - GitHub: - Upstream data source: - This service **does not store Onionoo data**, it only forwards requests and transforms responses. - Primary motivation: Onionoo has a solid spec, but **no OpenAPI**; this service provides a friendly schema **for tooling/AI agents**. Reference spec: [Tor Metrics – Onionoo](https://metrics.torproject.org/onionoo.html) ## Hosted instance - Service: `https://onionoo.anoni.net` - Swagger UI: `https://onionoo.anoni.net/docs` ## Releases Tagged releases (`vX.Y.Z`) trigger two GitHub Actions workflows: - `.github/workflows/release.yml` — builds the wheel/sdist and publishes to PyPI via Trusted Publishing. Register this workflow as a trusted publisher on the `onionoo-fastapi` PyPI project once before the first tag. - `.github/workflows/docker.yml` — builds a multi-arch image and pushes to `ghcr.io//onionoo-fastapi`. Uses the default `GITHUB_TOKEN`. Cut a release with: ```bash git tag -a v0.2.0 -m "Release 0.2.0" git push origin v0.2.0 ``` ## License MIT. See `LICENSE`. ## Requirements - Python 3.11+ - [`uv`](https://docs.astral.sh/uv/) ## Install ```bash git clone https://github.com/anoni-net/onionoo-fastapi cd onionoo-fastapi uv sync ``` Or if you already have the source: ```bash cd onionoo-fastapi uv sync ``` ## Run ```bash fastapi run app.main:app --reload --host 0.0.0.0 --port 8000 ``` **Note:** `fastapi run` requires FastAPI version 0