Skip to main content
GET
/
markets-by-token
/
{token_id}
Get market by token
curl --request GET \
  --url https://clob.polymarket.com/markets-by-token/{token_id}
import requests

url = "https://clob.polymarket.com/markets-by-token/{token_id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://clob.polymarket.com/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://clob.polymarket.com/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://clob.polymarket.com/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://clob.polymarket.com/markets-by-token/{token_id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://clob.polymarket.com/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": "0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af",
  "primary_token_id": "71321045679252212594626385532706912750332728571942532289631379312455583992563",
  "secondary_token_id": "52114319501245915516055106046884209969926127482827954674443846427813813222426"
}
{
"error": "<string>",
"code": "<string>",
"retry_after_seconds": 123
}
{
"error": "<string>",
"code": "<string>",
"retry_after_seconds": 123
}
{
"error": "<string>",
"code": "<string>",
"retry_after_seconds": 123
}

Path Parameters

token_id
string
required

The token ID to look up the parent market for

Response

Successfully retrieved market

Response for GET /markets-by-token/{token_id} — condition ID and both token IDs in the market.

condition_id
string
required

The condition ID of the market containing the given token

Example:

"0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af"

primary_token_id
string
required

The primary (Yes) token ID

Example:

"71321045679252212594626385532706912750332728571942532289631379312455583992563"

secondary_token_id
string
required

The secondary (No) token ID

Example:

"52114319501245915516055106046884209969926127482827954674443846427813813222426"