curl --request GET \
--url https://api.0xinsider.com/api/v1/fees/quote \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.0xinsider.com/api/v1/fees/quote"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.0xinsider.com/api/v1/fees/quote', 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.0xinsider.com/api/v1/fees/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.0xinsider.com/api/v1/fees/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.0xinsider.com/api/v1/fees/quote")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.0xinsider.com/api/v1/fees/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "fee_quote",
"data": {
"all_in_price": {
"gross": 123,
"net": 123
},
"as_of": "2023-11-07T05:31:56Z",
"condition_id": "<string>",
"event_slug": "<string>",
"fee_generated_usd": 123,
"fee_per_share": 123,
"fee_schedule": {
"basis": "observed",
"exponent": 123,
"fees_enabled": true,
"observed_at": "2023-11-07T05:31:56Z",
"rate": 123
},
"fee_usd": 123,
"line": 123,
"market_type": "moneyline",
"net_fee_usd": 123,
"notional_usd": 123,
"outcome": {
"index": 123,
"label": "<string>"
},
"price": {
"confirmed_age_seconds": 123,
"observed_at": "2023-11-07T05:31:56Z",
"source": "request",
"value": 123
},
"protocol_version": "v1",
"rebate_usd": 123,
"role": "taker",
"rules_version": "<string>",
"shares": 123,
"side": "buy",
"status": "ok",
"title": "<string>",
"unavailable_reason": "fee_schedule_unavailable",
"wallet": {
"maker_tier": {
"name": "<string>",
"next": {
"fees_needed_at_this_rate": 123,
"name": "<string>",
"wv_30d_needed": 123,
"wv_remaining": 123
},
"observed_at": "2023-11-07T05:31:56Z",
"own_wv_30d": 123,
"rebate": 123,
"rebate_bps": 123,
"snapshot_date": "<string>",
"status": "ok",
"tier": 123,
"unavailable_reason": "provider_timeout",
"wv_30d": 123
},
"taker_tier": {
"name": "<string>",
"next": {
"fees_needed_at_this_rate": 123,
"name": "<string>",
"wv_30d_needed": 123,
"wv_remaining": 123
},
"observed_at": "2023-11-07T05:31:56Z",
"rebate": 123,
"rule": "current",
"status": "ok",
"tier": 123,
"unavailable_reason": "provider_timeout",
"wv_30d": 123
}
},
"weighted_volume": 123
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}Get fee quote
Get what one Polymarket order on a game outcome costs in fees, taker or maker, and with a wallet, the rebate its tier returns.
curl --request GET \
--url https://api.0xinsider.com/api/v1/fees/quote \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.0xinsider.com/api/v1/fees/quote"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.0xinsider.com/api/v1/fees/quote', 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.0xinsider.com/api/v1/fees/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.0xinsider.com/api/v1/fees/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.0xinsider.com/api/v1/fees/quote")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.0xinsider.com/api/v1/fees/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "fee_quote",
"data": {
"all_in_price": {
"gross": 123,
"net": 123
},
"as_of": "2023-11-07T05:31:56Z",
"condition_id": "<string>",
"event_slug": "<string>",
"fee_generated_usd": 123,
"fee_per_share": 123,
"fee_schedule": {
"basis": "observed",
"exponent": 123,
"fees_enabled": true,
"observed_at": "2023-11-07T05:31:56Z",
"rate": 123
},
"fee_usd": 123,
"line": 123,
"market_type": "moneyline",
"net_fee_usd": 123,
"notional_usd": 123,
"outcome": {
"index": 123,
"label": "<string>"
},
"price": {
"confirmed_age_seconds": 123,
"observed_at": "2023-11-07T05:31:56Z",
"source": "request",
"value": 123
},
"protocol_version": "v1",
"rebate_usd": 123,
"role": "taker",
"rules_version": "<string>",
"shares": 123,
"side": "buy",
"status": "ok",
"title": "<string>",
"unavailable_reason": "fee_schedule_unavailable",
"wallet": {
"maker_tier": {
"name": "<string>",
"next": {
"fees_needed_at_this_rate": 123,
"name": "<string>",
"wv_30d_needed": 123,
"wv_remaining": 123
},
"observed_at": "2023-11-07T05:31:56Z",
"own_wv_30d": 123,
"rebate": 123,
"rebate_bps": 123,
"snapshot_date": "<string>",
"status": "ok",
"tier": 123,
"unavailable_reason": "provider_timeout",
"wv_30d": 123
},
"taker_tier": {
"name": "<string>",
"next": {
"fees_needed_at_this_rate": 123,
"name": "<string>",
"wv_30d_needed": 123,
"wv_remaining": 123
},
"observed_at": "2023-11-07T05:31:56Z",
"rebate": 123,
"rule": "current",
"status": "ok",
"tier": 123,
"unavailable_reason": "provider_timeout",
"wv_30d": 123
}
},
"weighted_volume": 123
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}{
"object": "error",
"error": {
"code": "bad_request",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"retry_at": "2023-11-07T05:31:56Z",
"freshness": {
"max_age_s": 1,
"data_quality_status": "fresh",
"actual_age_s": 1,
"as_of": "2023-11-07T05:31:56Z"
},
"billing_url": "<string>",
"reason": "cursor_expired"
},
"meta": {
"request_id": "<string>",
"cached": true,
"cost": 123,
"cache_age_s": 123
}
}wallet to read the wallet’s taker and maker tiers from Polymarket and price the rebate on this order. The market, its live book and its fee curve are the same reads as Get fair price.
Parameters
| Parameter | Meaning |
|---|---|
condition_id | The market’s condition id, raw or the mkt_-prefixed market.id, as markets[].condition_id on List game markets. The market must be a covered game’s. |
outcome | The outcome index to trade, 0 or 1, as outcomes[].index on List game markets. |
side | buy (the default) or sell the outcome’s shares. |
role | taker (the default): the order fills against the book and pays the fee. maker: the order rests on the book, pays no fee, and earns the wallet’s maker rebate on the taker fee its fill generates. |
shares | The order’s size in shares. Send shares or notional_usd, exactly one. |
notional_usd | The order’s size in USD before the fee; shares is notional_usd / price. |
price | Optional. The fill price, 0.001 to 0.999. Omitted, the quote uses the live book: the best ask for a taker buy or a maker sell, the best bid for a taker sell or a maker buy. |
wallet | Optional. The wallet you trade from, usually your Polymarket proxy wallet. 0xinsider does not store it or log it, and the response does not echo it. |
Key response fields
| Field | Meaning |
|---|---|
data.status | Checked in this order: closed (the market closed or resolved), unavailable with fee_schedule_unavailable (no fee record in hand; the quote never assumes a rate. A market’s first quote starts its fee read and waits for it briefly; if that read is still running, quote again in 1 to 2 seconds. The same answer again means Polymarket has no fee curve for the market), unavailable with the book’s reason (no price sent and the side it defaults to is missing), else ok. |
data.fee_per_share | rate x (p x (1 - p))^exponent at the fill price p, from the market’s own fee curve in data.fee_schedule. |
data.fee_usd | A taker’s fee: shares x fee_per_share, unrounded. Polymarket rounds each fill’s fee to 5 decimals when it matches. A maker’s is 0. |
data.fee_generated_usd | The taker fee the fill generates: the base of a maker rebate. |
data.weighted_volume | What the fill adds toward the role’s rebate tier: shares x p x (1 - p) for a taker buy and a maker fill on a fee-paying market, 0 on a fee-free one, and null for a taker sell, which Polymarket’s taker rebate page does not define. |
data.wallet.taker_tier, maker_tier | The wallet’s tiers as Polymarket reports them, each with the next tier up, the weighted volume it still needs and the fees that volume takes at this market’s rate. A tier not read is status: "unavailable": pending when a new wallet’s lookup is still running (quote again in 1 to 2 seconds; the tier is then cached for 10 minutes), rate_limited when tier lookups are at their limit (quote again in a few seconds), or provider_timeout or provider_error. |
data.rebate_usd, net_fee_usd | The rebate on this order and fee_usd - rebate_usd. A taker rebate is the tier’s share of fee_usd: Gold 10%, Platinum 25%, Diamond 40%, Obsidian 50%, Onyx 60%, and 0% for Tier 0 and the retired Bronze and Silver names. A maker rebate is the tier’s rebate_bps share of fee_generated_usd. null when the tier is unavailable; the gross fee still serves. |
data.rules_version | The Polymarket rule set the figures apply. |
null, never 0. An unknown condition id is a 404.
Example
curl -sS \
-H "Authorization: Bearer $OXINSIDER_API_KEY" \
'https://api.0xinsider.com/api/v1/fees/quote?condition_id=0x...&outcome=0¬ional_usd=100&price=0.45'
0.05, that $100 taker buy at 45 cents is 222.22 shares, fee_per_share 0.012375 and fee_usd 2.75. @0xinsider/sdk 0.126.11 adds getFeeQuote. The free fee calculator on 0xinsider.com reads the same figures with no key.
What it does not return
- The fee Polymarket finally charges an order that fills in several parts: each fill is rounded on its own, so the total can differ by a fraction of a cent.
- A tier for a wallet Polymarket does not answer for. The tier is
unavailableand the after-rebate figures arenull.
Authorizations
Legacy default or named integration API key, or OAuth 2.1 access token, in the Authorization header as Bearer oxi_sk_live_... or Bearer oxi_at_.... Default keys retain full access; integration keys are limited to their approved read, webhooks, export and usage scopes and expire within 90 days. All credentials share the owner's account limits. Data calls require an active Pro subscription and return live data. A 401 carries WWW-Authenticate: Bearer resource_metadata="https://api.0xinsider.com/.well-known/oauth-protected-resource" (RFC 6750 section 3, RFC 9728).
Scopes
Headers
Opt into strict query-name validation. The default is compatible: unknown names are ignored and reported in X-Query-Ignored. With strict, an unknown name returns 400 bad_request with error.reason unknown_query_parameter before the handler runs, including when its percent escape is incomplete.
strict Query Parameters
Was this page helpful?