Get unmatched orders
curl --request GET \
--url https://api.4casters.io/user/getUnmatched \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/user/getUnmatched"
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/user/getUnmatched', 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/getUnmatched",
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/user/getUnmatched"
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/user/getUnmatched")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/user/getUnmatched")
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{
"data": {
"unmatched": [
{
"id": "<string>",
"txID": "<string>",
"type": "moneyline",
"bet": 123,
"odds": 123,
"spread": 123,
"total": 123,
"participantID": "<string>",
"otherParticipantID": "<string>",
"expiry": "2023-11-07T05:31:56Z",
"filled": 123,
"offered": 123,
"remaining": 123,
"takenRatio": 123,
"createdAt": "2023-11-07T05:31:56Z",
"origin": "<string>",
"graded": true,
"closed": true,
"adminRefund": true,
"userReference": "<string>",
"wagerRequestID": "<string>",
"game": {
"id": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"eventName": "<string>",
"isFutures": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"homeAway": "home",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
]
}
}
]
}
}用户
获取未撮合订单
列出你在交易所上挂着的未成交订单
GET
/
user
/
getUnmatched
Get unmatched orders
curl --request GET \
--url https://api.4casters.io/user/getUnmatched \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/user/getUnmatched"
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/user/getUnmatched', 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/getUnmatched",
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/user/getUnmatched"
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/user/getUnmatched")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/user/getUnmatched")
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{
"data": {
"unmatched": [
{
"id": "<string>",
"txID": "<string>",
"type": "moneyline",
"bet": 123,
"odds": 123,
"spread": 123,
"total": 123,
"participantID": "<string>",
"otherParticipantID": "<string>",
"expiry": "2023-11-07T05:31:56Z",
"filled": 123,
"offered": 123,
"remaining": 123,
"takenRatio": 123,
"createdAt": "2023-11-07T05:31:56Z",
"origin": "<string>",
"graded": true,
"closed": true,
"adminRefund": true,
"userReference": "<string>",
"wagerRequestID": "<string>",
"game": {
"id": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"eventName": "<string>",
"isFutures": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"homeAway": "home",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
]
}
}
]
}
}返回调用方当前挂在交易所上、可供撮合的全部未成交订单。
请求
GET /user/getUnmatched
不接受参数。
curl https://api.4casters.io/user/getUnmatched \
-H "Authorization: Bearer YOUR_TOKEN"
响应
array
未成交订单数组,按开赛时间升序排列。
显示 UnmatchedOrder
显示 UnmatchedOrder
string
订单 ID。
string
订单创建的事务 ID。
string
moneyline、spread、total 或 moneyline1x2。number
原始
bet(风险额)。integer
美式赔率。
number
出现在
spread 上。number
出现在
total 上。string
出现在
moneyline 和 spread 上 — 所支持的参赛方。string
对方参赛方 ID(被挂出的一侧)。
number
已被撮合的风险额。
number
原始挂单金额(已撮合 + 剩余)。
number
该订单上仍可成交的可赢金额(吃单方支付风险额以获取)。
number
订单已撮合的比例,介于
0 和 1 之间。string
取消时间戳(ISO 8601)。未设置过期时间时为
null。string
ISO 8601 时间戳。
string
offer 或 wager。string
下单时保留的客户端自定义标识。
string
服务器生成的 ID,将原始下单请求产生的每一笔成交 / 挂单归为一组。
boolean
始终为
false。boolean
boolean
示例
{
"data": {
"unmatched": [
{
"id": "62851e3bd54b74e52c39953c",
"txID": "62851e3bd54b74e52c39953b",
"type": "moneyline",
"bet": 100,
"odds": 165,
"spread": null,
"total": null,
"participantID": "6165e6e23c65e61a09bf1f73",
"otherParticipantID": "626dca8a83899580a06ba87e",
"filled": 0,
"offered": 100,
"remaining": 100,
"takenRatio": 0,
"expiry": "2022-05-18T23:08:00.000Z",
"createdAt": "2022-05-18T16:26:35.601Z",
"origin": "offer",
"graded": false,
"closed": false,
"adminRefund": false,
"game": {
"id": "62823d9d75d894042dfee218",
"league": "NHL",
"sport": "hockey",
"start": "2022-05-18T23:08:00.000Z",
"ended": false,
"eventName": "NEW YORK RANGERS VS CAROLINA HURRICANES",
"isFutures": false,
"participants": [/* ... */]
}
}
]
}
}
此页面对您有帮助吗?