Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt

Use this file to discover all available pages before exploring further.

The MCR API returns a machine’s credit rating along with event counts, revenue trend, and bond status. It’s a public read API. No authentication required.

Endpoint

GET {PEAQOS_MCR_API_URL}/mcr/{did}
{did} accepts either a full DID (did:peaq:0xabc...) or a raw EVM address (0xabc...). Set PEAQOS_MCR_API_URL to the root of the MCR API server. The public peaq-hosted MCR is at https://mcr.peaq.xyz. Self-hosted deployments default to http://127.0.0.1:8000.

Fetch the MCR

curl -s "${PEAQOS_MCR_API_URL}/mcr/did:peaq:0xabc1230000000000000000000000000000000001"

Response shape

{
  "did": "did:peaq:0xabc1230000000000000000000000000000000001",
  "machine_id": 1,
  "mcr_score": 45,
  "mcr": "BB",
  "mcr_degraded": false,
  "bond_status": "bonded",
  "negative_flag": false,
  "event_count": 12,
  "revenue_event_count": 7,
  "activity_event_count": 5,
  "revenue_trend": "stable",
  "total_revenue": 35000,
  "average_revenue_per_event": 5000.0,
  "last_updated": 1711900000
}
total_revenue and average_revenue_per_event are USD cents. Divide by 100 for display (350and350 and 50 in this example). A newly registered machine that hasn’t accumulated enough history returns mcr: "Provisioned" with mcr_score: 0. Unbonded machines return mcr: "NR" with mcr_score: 0. See GET /mcr/{did} for the full field reference.

Query an operator’s fleet

Use the operator endpoint to list all machines registered under a proxy operator, paginated with MCR scores per machine.
curl -s "${PEAQOS_MCR_API_URL}/operator/did:peaq:0xProxyAddress/machines?offset=0&limit=20"
See GET /operator/{did}/machines for the full response shape and pagination details.

Caching

The server applies a 1-hour TTL on MCR responses by default, configurable via the MCR_CACHE_TTL env var (0 to disable). Repeat requests within the window return cached values. The last_updated field tells you when the underlying events were most recently added.

Error handling

The MCR API returns standard HTTP status codes: 404 when the DID is unregistered, 503 when the chain is unavailable, 400 for malformed inputs. Bodies are JSON with a detail field carrying the upstream message. If you call through the SDK (client.queryMcr / client.query_mcr), HTTP failures surface as RuntimeError (JS) or ApiError (Python). The code attribute carries NOT_FOUND, SERVICE_UNAVAILABLE, SERVER_ERROR, TIMEOUT, etc. See SDK errors reference for the full code map.

Next steps