Get average price
curl --request GET \
--url https://api.4casters.io/exchange/getOddsForAveragePrice \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/exchange/getOddsForAveragePrice"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.4casters.io/exchange/getOddsForAveragePrice', 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.4casters.io/exchange/getOddsForAveragePrice",
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.4casters.io/exchange/getOddsForAveragePrice"
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.4casters.io/exchange/getOddsForAveragePrice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/getOddsForAveragePrice")
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{
"games": [
{
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"homeAway": "home",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
],
"matchedVolume": 123,
"mainHomeSpread": "<unknown>",
"mainAwaySpread": "<unknown>",
"mainTotal": "<unknown>",
"odds": {
"averageHomeMoneyline": 123,
"bestHomeMoneyline": 123,
"bestHomeMoneylineWithCommission": 123,
"bestHomeMoneylinePriceLimit": 123,
"averageAwayMoneyline": 123,
"bestAwayMoneyline": 123,
"bestAwayMoneylineWithCommission": 123,
"bestAwayMoneylinePriceLimit": 123,
"averageHomeSpread": 123,
"bestHomeSpread": 123,
"bestHomeSpreadWithCommission": 123,
"bestHomeSpreadPriceLimit": 123,
"mainHomeSpread": "<unknown>",
"averageAwaySpread": 123,
"bestAwaySpread": 123,
"bestAwaySpreadWithCommission": 123,
"bestAwaySpreadPriceLimit": 123,
"mainAwaySpread": "<unknown>",
"averageOver": 123,
"bestOver": 123,
"bestOverWithCommission": 123,
"bestOverPriceLimit": 123,
"averageUnder": 123,
"bestUnder": 123,
"bestUnderWithCommission": 123,
"bestUnderPriceLimit": 123,
"mainTotal": "<unknown>",
"maxMoneyLineBet": 123,
"homeMoneylineMaxBet": 123,
"awayMoneylineMaxBet": 123,
"maxTotalBet": 123,
"maxOverBet": 123,
"maxUnderBet": 123,
"maxSpreadBet": 123,
"maxHomeSpreadBet": 123,
"maxAwaySpreadBet": 123
}
}
]
}市場
獲取均價
某聯賽中每場賽事的最優價與均價
GET
/
exchange
/
getOddsForAveragePrice
Get average price
curl --request GET \
--url https://api.4casters.io/exchange/getOddsForAveragePrice \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/exchange/getOddsForAveragePrice"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.4casters.io/exchange/getOddsForAveragePrice', 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.4casters.io/exchange/getOddsForAveragePrice",
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.4casters.io/exchange/getOddsForAveragePrice"
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.4casters.io/exchange/getOddsForAveragePrice")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/getOddsForAveragePrice")
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{
"games": [
{
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"homeAway": "home",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
],
"matchedVolume": 123,
"mainHomeSpread": "<unknown>",
"mainAwaySpread": "<unknown>",
"mainTotal": "<unknown>",
"odds": {
"averageHomeMoneyline": 123,
"bestHomeMoneyline": 123,
"bestHomeMoneylineWithCommission": 123,
"bestHomeMoneylinePriceLimit": 123,
"averageAwayMoneyline": 123,
"bestAwayMoneyline": 123,
"bestAwayMoneylineWithCommission": 123,
"bestAwayMoneylinePriceLimit": 123,
"averageHomeSpread": 123,
"bestHomeSpread": 123,
"bestHomeSpreadWithCommission": 123,
"bestHomeSpreadPriceLimit": 123,
"mainHomeSpread": "<unknown>",
"averageAwaySpread": 123,
"bestAwaySpread": 123,
"bestAwaySpreadWithCommission": 123,
"bestAwaySpreadPriceLimit": 123,
"mainAwaySpread": "<unknown>",
"averageOver": 123,
"bestOver": 123,
"bestOverWithCommission": 123,
"bestOverPriceLimit": 123,
"averageUnder": 123,
"bestUnder": 123,
"bestUnderWithCommission": 123,
"bestUnderPriceLimit": 123,
"mainTotal": "<unknown>",
"maxMoneyLineBet": 123,
"homeMoneylineMaxBet": 123,
"awayMoneylineMaxBet": 123,
"maxTotalBet": 123,
"maxOverBet": 123,
"maxUnderBet": 123,
"maxSpreadBet": 123,
"maxHomeSpreadBet": 123,
"maxAwaySpreadBet": 123
}
}
]
}回傳某聯賽中每場賽事的最優價與均價的截斷列表。對每場賽事和每個市場(moneyline / spread / total),回應包含:
- 最優價格(最優掛單上的價格);
- 掃掉至少 $500 流動性時你會支付的均價;
- 可按最優價格和均價成交的最大投注額。
awayMoneylines、homeMoneylines 等)已被剝離;僅保留彙總的 odds 塊。
與大多數端點不同,此端點在頂層回傳賽事(不在
data 下)。請求
GET /exchange/getOddsForAveragePrice
string
必填
聯賽代碼(不區分大小寫)。
curl "https://api.4casters.io/exchange/getOddsForAveragePrice?leagueRequested=NBA" \
-H "Authorization: Bearer YOUR_TOKEN"
回應
array
每個
game 為標準 Game 形態,並帶有以下附加欄位:顯示 單場附加欄位
顯示 單場附加欄位
number
string
number
string
object
獨贏、讓分和大小分的最優 / 均價以及最大投注額。
顯示 odds
顯示 odds
integer
integer
integer
integer
主隊獨贏最優價下的最大投注額。
integer
integer
integer
integer
integer
integer
integer
integer
string
integer
integer
integer
integer
number
integer
integer
integer
integer
integer
integer
integer
integer
string
integer
homeMoneylineMaxBet 與 awayMoneylineMaxBet 的較大值。integer
integer
integer
integer
integer
integer
integer
integer
授權
Pass your auth token in the Authorization header. The Bearer prefix is optional; the server also accepts a signed auth cookie or a token field in the request body.
查詢參數
League code (case-insensitive).
回應
Game best/average prices
Show child attributes
Show child attributes
這個頁面有幫助嗎?