API Reference
GET /machine/{did}
Return the full machine profile for a machine DID.
GET
/
machine
/
{did}
GET /machine/{did}
curl --request GET \
--url https://mcr.peaq.xyz/machine/{did}import requests
url = "https://mcr.peaq.xyz/machine/{did}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mcr.peaq.xyz/machine/{did}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mcr.peaq.xyz/machine/{did}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mcr.peaq.xyz/machine/{did}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mcr.peaq.xyz/machine/{did}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mcr.peaq.xyz/machine/{did}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyEndpoint
GET /machine/{did}
GET /metadata/{token_id}; both return the same shape.
Path parameters
string
required
Machine DID in the form
did:peaq:<decimal machine id>, with no leading zeros. Address DIDs (did:peaq:0x...), raw addresses and bare machine IDs return 400.Response
200 OK: base fields (always present)| Field | Type | Description |
|---|---|---|
schema_version | string | Always "1.0" |
name | string | "Machine #<machine_id>" |
peaqos.machine_id | string | Machine ID as a decimal string (a 256-bit value; parse with BigInt in JavaScript) |
peaqos.did | string | Machine DID |
peaqos.operator | string or null | Operator DID (did:peaq:0x<address>, lowercased). For a peaq-homed machine this is the controller set in MachineRegistry; for a Solana-homed machine it is the peaq operator address recorded on the machine account. null if not set. |
peaqos.mcr | string | Letter rating: AAA, AA, A, BBB, BB, B, NR, or Provisioned |
peaqos.mcr_score | integer | MCR score 0-100 |
peaqos.bond_status | string | "bonded" or "unbonded" |
peaqos.negative_flag | boolean | true when the AdminFlags contract has a negative-flag timestamp set for this machine. Stays true for as long as the timestamp is recorded on-chain, regardless of whether the 180-day MCR scoring penalty is still in effect. |
peaqos.event_count | integer | Total on-chain event count. Always 0 for a Solana-homed machine on this endpoint, whatever it has submitted: read its count from GET /mcr/{did}. |
peaqos.data_visibility | string | Always "private" |
peaqos.documentation_url | string or null | The machine’s peaq-documentation service endpoint. null if not set. |
| Field | Type | Description |
|---|---|---|
peaqos.data_api | string | The machine’s peaq-data-api service endpoint. Present only when that endpoint is set. |
| Field | Type | Description |
|---|---|---|
peaqos.owner | string | Owner address on the home chain (base58 on Solana) |
peaqos.controller | string or null | Controller address on the home chain (base58 on Solana). null if not set. |
peaqos.machine_type | string | Machine type recorded on the machine account, for example "RobotArm" |
peaqos.home_chain | integer | Protocol chain ordinal of the home chain: 5 for Solana |
peaqos.relocating | boolean | false in a successful response: a relocating machine returns 503 |
peaqos.rating_unavailable | string | Always "event_history_not_indexed" on this endpoint |
peaqos.mcr and peaqos.mcr_score stay "Provisioned" and 0 for a Solana-homed machine. GET /mcr/{did} rates it from its indexed events. peaqos.operator stays an EVM address DID. See Machines and IDs.
Error responses
| Status | detail | Condition |
|---|---|---|
| 400 | "Empty DID" | Path parameter is empty |
| 400 | "Invalid machine DID format" | Path is not did:peaq:<decimal machine id>: an address DID, a raw address, a bare ID, a non-decimal value, a leading zero, or a value above 2^256-1 |
| 404 | "Machine not registered" | No chain records a machine with this ID |
| 409 | {"code": "MACHINE_HOMED_ELSEWHERE", "home_protocol_chain_id", "message"} | The machine is homed on a chain this server cannot read |
| 429 | "rate_limited" | The server’s budget for home-chain lookups is spent; slow down and retry |
| 503 | "Machine is relocating to another chain; retry later" | The machine is moving between chains |
| 503 | "machine home chain is unreachable; retry later" | Reading a Solana-homed machine’s record failed |
| 503 | "Service not initialised" | Server started without contract addresses |
| 503 | "Chain unavailable" | Any chain call failed |
Example
curl "${PEAQOS_MCR_API_URL:-https://mcr.peaq.xyz}/machine/did:peaq:108934426058480933785963234320575706003575332367737915173645220784539698794848"
const PEAQOS_MCR_API_URL = process.env.PEAQOS_MCR_API_URL ?? "https://mcr.peaq.xyz";
const response = await fetch(
`${PEAQOS_MCR_API_URL}/machine/did:peaq:108934426058480933785963234320575706003575332367737915173645220784539698794848`
);
const data = await response.json();
console.log(data.peaqos.mcr, data.peaqos.operator);
import os
import requests
PEAQOS_MCR_API_URL = os.environ.get("PEAQOS_MCR_API_URL", "https://mcr.peaq.xyz")
response = requests.get(
f"{PEAQOS_MCR_API_URL}/machine/did:peaq:108934426058480933785963234320575706003575332367737915173645220784539698794848"
)
data = response.json()
print(data["peaqos"]["mcr"], data["peaqos"]["operator"])
{
"schema_version": "1.0",
"name": "Machine #108934426058480933785963234320575706003575332367737915173645220784539698794848",
"peaqos": {
"machine_id": "108934426058480933785963234320575706003575332367737915173645220784539698794848",
"did": "did:peaq:108934426058480933785963234320575706003575332367737915173645220784539698794848",
"operator": "did:peaq:0x47d0d49382bdbe6f969056aab22edc56cc59fe4f",
"mcr": "Provisioned",
"mcr_score": 0,
"bond_status": "bonded",
"negative_flag": false,
"event_count": 0,
"data_visibility": "private",
"documentation_url": null
}
}
{
"schema_version": "1.0",
"name": "Machine #59553499179785547240541790107334615076028120679642018345696955698709980164819",
"peaqos": {
"machine_id": "59553499179785547240541790107334615076028120679642018345696955698709980164819",
"did": "did:peaq:59553499179785547240541790107334615076028120679642018345696955698709980164819",
"operator": "did:peaq:0xb14915bb526ef95cee4a0ce174c5dd7fa44da04c",
"owner": "HJwPTPKVqrAK9UPVwkERTRbj1PfRokGDmyemgv5cR6gP",
"controller": "HJwPTPKVqrAK9UPVwkERTRbj1PfRokGDmyemgv5cR6gP",
"machine_type": "RobotArm",
"home_chain": 5,
"relocating": false,
"event_count": 0,
"data_visibility": "private",
"documentation_url": null,
"bond_status": "bonded",
"negative_flag": false,
"mcr": "Provisioned",
"mcr_score": 0,
"rating_unavailable": "event_history_not_indexed"
}
}
Related endpoints
GET /mcr/{did}returns a focused MCR score response with revenue trend and summary.GET /metadata/{token_id}returns the same response shape, resolved by NFT token ID instead of DID.GET /machines/{machine_id}returns the peaqOS Machine Card resolved by numeric machine ID.
⌘I
GET /machine/{did}
curl --request GET \
--url https://mcr.peaq.xyz/machine/{did}import requests
url = "https://mcr.peaq.xyz/machine/{did}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mcr.peaq.xyz/machine/{did}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mcr.peaq.xyz/machine/{did}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mcr.peaq.xyz/machine/{did}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mcr.peaq.xyz/machine/{did}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mcr.peaq.xyz/machine/{did}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
