API Reference
GET /machines/{machine_id}
Return a peaqOS Machine Card for a machine identified by its numeric machine ID.
GET
/
machines
/
{machine_id}
GET /machines/{machine_id}
curl --request GET \
--url https://mcr.peaq.xyz/machines/{machine_id}import requests
url = "https://mcr.peaq.xyz/machines/{machine_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mcr.peaq.xyz/machines/{machine_id}', 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/machines/{machine_id}",
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/machines/{machine_id}"
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/machines/{machine_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mcr.peaq.xyz/machines/{machine_id}")
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 /machines/{machine_id}
Path parameters
integer
required
Decimal machine ID (not a DID). Must be
1 or greater. The route sets no upper bound: a value above 2^256-1 returns 503 "Chain unavailable".Response
200 OK| Field | Type | Description |
|---|---|---|
type | string | peaqOS registration type: "peaqos:registration:v1" |
name | string | "Machine #<machine_id>" |
description | string | Fixed string: "peaqOS machine" |
did | string | Machine DID: did:peaq:<machine_id> |
active | boolean | Always true for registered machines |
services | array | List of service endpoints. Contains one "web" entry if the machine has a peaq-data-api service endpoint; otherwise empty. |
services[].name | string | "web" |
services[].endpoint | string | Value of the peaq-data-api service endpoint |
data_visibility | string | Always "private" |
documentation_url | string | The machine’s peaq-documentation service endpoint. Empty string if not set. |
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. |
bond_status | string | "bonded" or "unbonded" |
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}. |
registrations | array | List of registry references (always one entry) |
registrations[].type | string | "peaqos:registration:v1" |
registrations[].machineId | string | The machine ID as a decimal string |
registrations[].machineRegistry | string | Registry identifier. eip155:<chainId>:<MachineRegistry address> for a peaq-homed machine, solana:<chain reference>:<program id> for a Solana-homed machine. |
chainId in machineRegistry is read from the connected RPC at server startup (3338 for peaq ).
Error responses
| Status | detail | Condition |
|---|---|---|
| 404 | "Machine not found" | 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 |
| 422 | (FastAPI validation error) | machine_id is less than 1 or not an integer |
| 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, including a lookup for a machine_id above 2^256-1 |
Example
curl "${PEAQOS_MCR_API_URL:-https://mcr.peaq.xyz}/machines/108934426058480933785963234320575706003575332367737915173645220784539698794848"
const PEAQOS_MCR_API_URL = process.env.PEAQOS_MCR_API_URL ?? "https://mcr.peaq.xyz";
const response = await fetch(
`${PEAQOS_MCR_API_URL}/machines/108934426058480933785963234320575706003575332367737915173645220784539698794848`
);
const data = await response.json();
console.log(data.name, data.bond_status, data.registrations);
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}/machines/108934426058480933785963234320575706003575332367737915173645220784539698794848"
)
data = response.json()
print(data["name"], data["bond_status"], data["registrations"])
{
"type": "peaqos:registration:v1",
"name": "Machine #108934426058480933785963234320575706003575332367737915173645220784539698794848",
"description": "peaqOS machine",
"did": "did:peaq:108934426058480933785963234320575706003575332367737915173645220784539698794848",
"active": true,
"services": [],
"data_visibility": "private",
"documentation_url": "",
"operator": "did:peaq:0x47d0d49382bdbe6f969056aab22edc56cc59fe4f",
"bond_status": "bonded",
"event_count": 0,
"registrations": [
{
"type": "peaqos:registration:v1",
"machineId": "108934426058480933785963234320575706003575332367737915173645220784539698794848",
"machineRegistry": "eip155:3338:0x64b93Cc29b251fAFa83BD110cDB1C24207f85536"
}
]
}
{
"type": "peaqos:registration:v1",
"name": "Machine #59553499179785547240541790107334615076028120679642018345696955698709980164819",
"description": "peaqOS machine",
"did": "did:peaq:59553499179785547240541790107334615076028120679642018345696955698709980164819",
"active": true,
"services": [],
"data_visibility": "private",
"documentation_url": "",
"operator": "did:peaq:0xb14915bb526ef95cee4a0ce174c5dd7fa44da04c",
"bond_status": "bonded",
"event_count": 0,
"registrations": [
{
"type": "peaqos:registration:v1",
"machineId": "59553499179785547240541790107334615076028120679642018345696955698709980164819",
"machineRegistry": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:AgR8exgW2mwpf4v2PpojYuDHXVBThZtenS6XYjV4JnUD"
}
]
}
Related endpoints
GET /machine/{did}returns the full machine profile with MCR score.GET /mcr/{did}returns the detailed MCR score, revenue trend, and revenue summary.GET /metadata/{token_id}returns NFT metadata for a machine token.
⌘I
GET /machines/{machine_id}
curl --request GET \
--url https://mcr.peaq.xyz/machines/{machine_id}import requests
url = "https://mcr.peaq.xyz/machines/{machine_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mcr.peaq.xyz/machines/{machine_id}', 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/machines/{machine_id}",
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/machines/{machine_id}"
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/machines/{machine_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mcr.peaq.xyz/machines/{machine_id}")
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
