Skip to content

REST API

SiriScore ships a FastAPI backend that exposes the same scoring engine as the Python library over HTTP. Use it from any language, or wire it into a wallet or payment flow.

Run the server

pip install siriscore
uvicorn api.main:app

The API is now at http://localhost:8000. The hosted instance behind siriscore.xyz exposes the same endpoints.

Quick example

curl -s http://localhost:8000/score \
  -H "Content-Type: application/json" \
  -d '{"input": "a4f1c9d2e3b5...", "input_type": "txid"}'
{
  "score": 72,
  "findings": [
    {
      "id": "H2",
      "title": "Round payment amount",
      "suggestion": "Consider using PayJoin to obscure the payment amount."
    }
  ],
  "checks": ["..."]
}

Endpoints

Endpoint Status Description
POST /score Live Score a single transaction
GET /labels / POST /labels Live Read and write the local label store. See Label System
POST /labels/import Live Import a Sparrow BIP329 label export
POST /score/batch Planned Score multiple transactions in one request
GET /heuristics Planned Metadata for every heuristic;IDs, weights, severity
GET /score/{txid} Planned Score by txid via a plain GET

Privacy

Calling a hosted instance sends your transaction data to that server, run the server locally to keep it on your machine. Scoring itself is offline by default: H3/H4 network lookups only run when the request sets "lookup": true.