Get Market BBO
curl --request GET \
--url https://gateway.polymarket.us/v1/markets/{slug}/bboimport requests
url = "https://gateway.polymarket.us/v1/markets/{slug}/bbo"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://gateway.polymarket.us/v1/markets/{slug}/bbo', 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://gateway.polymarket.us/v1/markets/{slug}/bbo",
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://gateway.polymarket.us/v1/markets/{slug}/bbo"
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://gateway.polymarket.us/v1/markets/{slug}/bbo")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.polymarket.us/v1/markets/{slug}/bbo")
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{
"marketData": {
"marketSlug": "<string>",
"currentPx": {
"value": 123.45,
"currency": "<string>"
},
"lastTradePx": {
"value": 123.45,
"currency": "<string>"
},
"settlementPx": {
"value": 123.45,
"currency": "<string>"
},
"sharesTraded": "<string>",
"openInterest": "<string>",
"bestAsk": {
"value": 123.45,
"currency": "<string>"
},
"bestBid": {
"value": 123.45,
"currency": "<string>"
},
"askDepth": 123,
"bidDepth": 123,
"lastPriceSample": {
"longPx": {
"value": 123.45,
"currency": "<string>"
},
"shortPx": {
"value": 123.45,
"currency": "<string>"
},
"ts": "2023-11-07T05:31:56Z"
},
"longQuote": {
"value": 123.45,
"currency": "<string>"
},
"shortQuote": {
"value": 123.45,
"currency": "<string>"
}
}
}Get Market BBO
Retrieve current market data (best bid/offer, stats) for a specific market by its slug in a lightweight format
GET
/
v1
/
markets
/
{slug}
/
bbo
Get Market BBO
curl --request GET \
--url https://gateway.polymarket.us/v1/markets/{slug}/bboimport requests
url = "https://gateway.polymarket.us/v1/markets/{slug}/bbo"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://gateway.polymarket.us/v1/markets/{slug}/bbo', 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://gateway.polymarket.us/v1/markets/{slug}/bbo",
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://gateway.polymarket.us/v1/markets/{slug}/bbo"
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://gateway.polymarket.us/v1/markets/{slug}/bbo")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.polymarket.us/v1/markets/{slug}/bbo")
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{
"marketData": {
"marketSlug": "<string>",
"currentPx": {
"value": 123.45,
"currency": "<string>"
},
"lastTradePx": {
"value": 123.45,
"currency": "<string>"
},
"settlementPx": {
"value": 123.45,
"currency": "<string>"
},
"sharesTraded": "<string>",
"openInterest": "<string>",
"bestAsk": {
"value": 123.45,
"currency": "<string>"
},
"bestBid": {
"value": 123.45,
"currency": "<string>"
},
"askDepth": 123,
"bidDepth": 123,
"lastPriceSample": {
"longPx": {
"value": 123.45,
"currency": "<string>"
},
"shortPx": {
"value": 123.45,
"currency": "<string>"
},
"ts": "2023-11-07T05:31:56Z"
},
"longQuote": {
"value": 123.45,
"currency": "<string>"
},
"shortQuote": {
"value": 123.45,
"currency": "<string>"
}
}
}⌘I