CLOB Read (Public)
Get Market By Token
Polymarket-compat GET /markets-by-token/{token_id}.
Reverse-resolve a CLOB token id to its parent condition_id
- the canonical outcome label.
GET
/
v1
/
markets-by-token
/
{token_id}
Get Market By Token
curl --request GET \
--url https://api.polysimulator.com/v1/markets-by-token/{token_id}import requests
url = "https://api.polysimulator.com/v1/markets-by-token/{token_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.polysimulator.com/v1/markets-by-token/{token_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.polysimulator.com/v1/markets-by-token/{token_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.polysimulator.com/v1/markets-by-token/{token_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.polysimulator.com/v1/markets-by-token/{token_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polysimulator.com/v1/markets-by-token/{token_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{
"condition_id": "<string>",
"primary_token_id": "<string>",
"secondary_token_id": "<string>",
"outcome": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}Was this page helpful?
Previous
Post Midpoints BatchPolymarket-compat ``POST /midpoints``.
Body: ``[{token_id}, {token_id}, ...]`` (PM-compat) **or**
``{items: [{token_id}, ...]}`` (legacy wrapped form). Returns
``{token_id: midpoint_string}``. Bounded to 50 tokens per
request to match PM's documented cap.
Next
⌘I
Get Market By Token
curl --request GET \
--url https://api.polysimulator.com/v1/markets-by-token/{token_id}import requests
url = "https://api.polysimulator.com/v1/markets-by-token/{token_id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.polysimulator.com/v1/markets-by-token/{token_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.polysimulator.com/v1/markets-by-token/{token_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.polysimulator.com/v1/markets-by-token/{token_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.polysimulator.com/v1/markets-by-token/{token_id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polysimulator.com/v1/markets-by-token/{token_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{
"condition_id": "<string>",
"primary_token_id": "<string>",
"secondary_token_id": "<string>",
"outcome": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}