Get graded bets
curl --request GET \
--url https://api.4casters.io/user/v2/getGraded \
--header 'Authorization: <api-key>'import requests
url = "https://api.4casters.io/user/v2/getGraded"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.4casters.io/user/v2/getGraded', 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/user/v2/getGraded",
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: <api-key>"
],
]);
$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/user/v2/getGraded"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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/user/v2/getGraded")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/user/v2/getGraded")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"graded": [
{
"game": {
"isSpecials": true,
"tournamentName": "<string>",
"periodName": "<string>",
"id": "<string>",
"league": "<string>",
"live": true,
"sport": "<string>",
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"futuresSide": "<string>",
"mainPitcher": "<string>",
"homeAway": "home",
"score": 123,
"rotationNumber": "<string>"
}
],
"isYesNo": true,
"eventName": "<string>",
"ended": true,
"parentGameID": "<string>",
"start": "2026-08-01T00:00:00.000Z"
},
"id": "<string>",
"type": "moneyline",
"bet": 123,
"txID": "<string>",
"closed": false,
"ticketNumber": "<string>",
"odds": 123,
"fee": "<string>",
"risk": "<string>",
"win": "<string>",
"origin": "wager",
"cancelled": false,
"outcome": "winner",
"graded": true,
"createdAt": "2026-08-01T00:00:00.000Z",
"adminRefund": true,
"wagerRequestID": "<string>",
"userReference": "<string>",
"isPostArb": true,
"isOutright": true,
"outrightParticipant": {
"longName": "<string>",
"shortName": "<string>",
"outcome": "<string>"
},
"matchedTime": "2026-08-01T00:00:00.000Z",
"settledAt": "2026-08-01T00:00:00.000Z",
"platform": "<string>",
"result": "<string>",
"participantID": "<string>",
"spread": 123,
"total": 123,
"OU": "over",
"side": "yes",
"market": "<string>"
}
],
"summary": {
"pnl": 123,
"volume": 123
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}用户
获取已结算投注
按开赛日期窗口返回已结算投注,每笔成交一行,并附盈亏汇总
GET
/
user
/
v2
/
getGraded
Get graded bets
curl --request GET \
--url https://api.4casters.io/user/v2/getGraded \
--header 'Authorization: <api-key>'import requests
url = "https://api.4casters.io/user/v2/getGraded"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.4casters.io/user/v2/getGraded', 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/user/v2/getGraded",
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: <api-key>"
],
]);
$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/user/v2/getGraded"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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/user/v2/getGraded")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/user/v2/getGraded")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"graded": [
{
"game": {
"isSpecials": true,
"tournamentName": "<string>",
"periodName": "<string>",
"id": "<string>",
"league": "<string>",
"live": true,
"sport": "<string>",
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"futuresSide": "<string>",
"mainPitcher": "<string>",
"homeAway": "home",
"score": 123,
"rotationNumber": "<string>"
}
],
"isYesNo": true,
"eventName": "<string>",
"ended": true,
"parentGameID": "<string>",
"start": "2026-08-01T00:00:00.000Z"
},
"id": "<string>",
"type": "moneyline",
"bet": 123,
"txID": "<string>",
"closed": false,
"ticketNumber": "<string>",
"odds": 123,
"fee": "<string>",
"risk": "<string>",
"win": "<string>",
"origin": "wager",
"cancelled": false,
"outcome": "winner",
"graded": true,
"createdAt": "2026-08-01T00:00:00.000Z",
"adminRefund": true,
"wagerRequestID": "<string>",
"userReference": "<string>",
"isPostArb": true,
"isOutright": true,
"outrightParticipant": {
"longName": "<string>",
"shortName": "<string>",
"outcome": "<string>"
},
"matchedTime": "2026-08-01T00:00:00.000Z",
"settledAt": "2026-08-01T00:00:00.000Z",
"platform": "<string>",
"result": "<string>",
"participantID": "<string>",
"spread": 123,
"total": 123,
"OU": "over",
"side": "yes",
"market": "<string>"
}
],
"summary": {
"pnl": 123,
"volume": 123
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}返回你在某个日期窗口内开赛的赛事上的已结算(已判定)投注,以及盈亏和成交量汇总。
此端点适用于针对已知时段的报表(例如“上周所有赛事”)。若要让本地历史副本随投注结算保持同步,请改用 按游标获取已结算投注 — 它按结算顺序依次遍历,因此你无需猜测日期窗口。
在极少数情况下,某行对应的订单无法加载。该行仅包含
行的组织方式
- 每笔成交一行。 一个成交了三次的订单会返回三行,每行有各自的
txID。请将txID作为行的唯一标识。 - 订单簿的两侧都包含在内。 你吃掉的订单以
origin: "wager"出现;你挂出并被他人吃掉的订单以origin: "offer"出现。无论哪种情况,bet和odds都从你的一侧给出。 - **日期对应赛事的开赛时间,**而不是结算时间。结算较晚的投注仍归入其赛事所在的窗口。
- 每一行都内嵌了赛事信息。
请求
GET /user/v2/getGraded
同样的参数也可以通过 POST /user/v2/getGraded 以 JSON 请求体发送。
发送
startDate 时,从 startDate 到 endDate 的窗口最长为 35 天。超出的窗口会以 400 拒绝 — 绝不会被静默截断。更长的时段请以 35 天为步长分页查询。curl "https://api.4casters.io/user/v2/getGraded?startDate=2026-08-01T00:00:00.000Z&endDate=2026-08-08T00:00:00.000Z" \
-H "Authorization: Bearer YOUR_TOKEN"
响应
窗口内你的已结算成交。
显示 GradedBet
显示 GradedBet
行上的金额字段(
fee、risk、win、result)是保留两位小数的字符串,因此可以精确相加。summary 合计为四舍五入后的数字。txID、ticketNumber、settledAt、matchedTime 和 game,且其 id 是对象 { "_id": "…", "error": "…" } 而非字符串。请跳过或记录该行。
示例
一笔以 -110 吃单买大、本金 $100 且输掉的投注,佣金为 1%:{
"data": {
"graded": [
{
"txID": "66b2a1f0c3e4d5a6b7c8d9e0",
"id": "66b2a1e9c3e4d5a6b7c8d9d1",
"ticketNumber": "8f3c2a1b9d4e5f60718293a4b5c6d7e8",
"origin": "wager",
"type": "total",
"outcome": "loser",
"bet": 100,
"odds": -110,
"total": 8.5,
"OU": "over",
"fee": "1.00",
"risk": "101.00",
"win": "89.91",
"result": "-101.00",
"createdAt": "2026-08-01T23:10:04.112Z",
"matchedTime": "2026-08-01T23:10:04.380Z",
"settledAt": "2026-08-02T02:41:57.003Z",
"graded": true,
"adminRefund": false,
"cancelled": false,
"wagerRequestID": null,
"userReference": "my-ref-1042",
"platform": "api",
"game": {
"id": "66b0f4e2a9b8c7d6e5f4a3b2",
"league": "MLB",
"sport": "baseball",
"start": "2026-08-01T23:05:00.000Z",
"ended": true,
"live": false,
"isSpecials": false,
"participants": [/* away, home */]
}
}
],
"summary": { "pnl": -101, "volume": 90 }
}
}
速率限制
每用户每分钟 60 次请求,并叠加 全局每 IP 限制。429 响应带有以秒为单位的 Retry-After 响应头。
错误
| 状态 | 含义 |
|---|---|
400 | 日期格式错误,或窗口超过 35 天。 |
401 | 认证令牌缺失或无效。 |
403 | 你的账户无权使用此端点。 |
429 | 触发速率限制。请等待 Retry-After 秒。 |
授权
查询参数
此页面对您有帮助吗?