Get market by numeric id
curl --request GET \
--url https://api-mainnet.xo.market/api/markets/{id}import requests
url = "https://api-mainnet.xo.market/api/markets/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-mainnet.xo.market/api/markets/{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://api-mainnet.xo.market/api/markets/{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://api-mainnet.xo.market/api/markets/{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://api-mainnet.xo.market/api/markets/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-mainnet.xo.market/api/markets/{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{
"id": 482,
"contractMarketId": "<string>",
"conditionId": "<string>",
"marketContractAddress": "<string>",
"versionId": 123,
"title": "<string>",
"slug": "<string>",
"description": "<string>",
"rules": {},
"category": [
{
"id": 7,
"name": "SPORTS"
}
],
"tags": [
"<string>"
],
"type": 0,
"status": "PENDING",
"startsAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"resolvedAt": "2023-11-07T05:31:56Z",
"totalVolume": "<string>",
"totalVolumeInUSD": "<string>",
"collateralTokenId": 3,
"imageUrl": "<string>",
"metadataUri": "<string>",
"winningOutcomeId": 123,
"outcomes": [
{
"id": 123,
"title": "YES",
"tokenId": "1234567890123456789012345678901234567890",
"position": 0
}
],
"visible": true,
"isFeatured": true
}Markets
Get market by numeric id
GET
/
markets
/
{id}
Get market by numeric id
curl --request GET \
--url https://api-mainnet.xo.market/api/markets/{id}import requests
url = "https://api-mainnet.xo.market/api/markets/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-mainnet.xo.market/api/markets/{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://api-mainnet.xo.market/api/markets/{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://api-mainnet.xo.market/api/markets/{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://api-mainnet.xo.market/api/markets/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-mainnet.xo.market/api/markets/{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{
"id": 482,
"contractMarketId": "<string>",
"conditionId": "<string>",
"marketContractAddress": "<string>",
"versionId": 123,
"title": "<string>",
"slug": "<string>",
"description": "<string>",
"rules": {},
"category": [
{
"id": 7,
"name": "SPORTS"
}
],
"tags": [
"<string>"
],
"type": 0,
"status": "PENDING",
"startsAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"resolvedAt": "2023-11-07T05:31:56Z",
"totalVolume": "<string>",
"totalVolumeInUSD": "<string>",
"collateralTokenId": 3,
"imageUrl": "<string>",
"metadataUri": "<string>",
"winningOutcomeId": 123,
"outcomes": [
{
"id": 123,
"title": "YES",
"tokenId": "1234567890123456789012345678901234567890",
"position": 0
}
],
"visible": true,
"isFeatured": true
}Path Parameters
Backend numeric market id.
Response
Market metadata.
Canonical market metadata. Identifiers MMs care about:
id— backend numeric id (used in/markets/{id}).conditionId—0x-prefixed 32-byte ConditionalTokens condition id. CLOB orderbook routes treat this asmarket_id.marketContractAddress— on-chain contract to target for transactions (settlement, pause/resolve, etc.). For V3 CLOB this is the unifiedXOClobMarketManager.
Example:
482
Canonical indexer key. For LMSR / V2 CLOB this is the wrapper
contract address; for V3 CLOB this equals conditionId.
0x-prefixed bytes32 ConditionalTokens condition id.
2 = V2 (LMSR / CLOB wrapper), 3 = V3 (XOClobMarketManager).
Show child attributes
Show child attributes
0=STANDARD, 1=PULSE, 2=CLOB, 3=CLOB_PULSE.
Available options:
0, 1, 2, 3 Available options:
PENDING, ACTIVE, PAUSED, CLOSED, RESOLVED, VOIDED, CANCELLED Total volume in WEI (collateral token base units).
Total volume in USD with 2-decimal precision.
Example:
3
Show child attributes
Show child attributes