Get midpoint prices (query parameters)
curl --request GET \
--url https://clob.polymarket.com/midpointsimport requests
url = "https://clob.polymarket.com/midpoints"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://clob.polymarket.com/midpoints', 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/midpoints",
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/midpoints"
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/midpoints")
.asString();require 'uri'
require 'net/http'
url = URI("https://clob.polymarket.com/midpoints")
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{
"0xabc123def456...": "0.45",
"0xdef456abc123...": "0.52"
}{
"error": "Invalid payload"
}{
"error": "error getting the mid price"
}Get midpoint prices (query parameters)
Retrieves midpoint prices for multiple token IDs using query parameters. The midpoint is calculated as the average of the best bid and best ask prices.
GET
/
midpoints
Get midpoint prices (query parameters)
curl --request GET \
--url https://clob.polymarket.com/midpointsimport requests
url = "https://clob.polymarket.com/midpoints"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://clob.polymarket.com/midpoints', 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/midpoints",
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/midpoints"
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/midpoints")
.asString();require 'uri'
require 'net/http'
url = URI("https://clob.polymarket.com/midpoints")
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{
"0xabc123def456...": "0.45",
"0xdef456abc123...": "0.52"
}{
"error": "Invalid payload"
}{
"error": "error getting the mid price"
}Was this page helpful?
⌘I