Private API Introduction
The Fairlay Private API allows you to POST requests (creating/changing markets and orders, transfering funds, etc.), costs 0.1mBTC per 100.000 requests, see below on how to create your developer API account.
This is the low level documentation, if you need a working sample or are more comfortable reading code rather than specifications, head over to .NET API Library or Python API Library
Requisites
- An account registered at fairlay
- A 2048 bits PEM RSA Key pair. There are multiple types of tools to generate it for you. Tools SSL Example
- Create an API account in profile page at https://fairlay.com/developer/api/new/. Will be requested to provide your public key on form.
Requests
This is a sample GETBALANCE Request using default ACCOUNT ID 1:
uiskPc9GqWAdUt1hJ+4VeuxyCNtbs0iY3kSbGQZ7HvwHkCe5H2n9UcX5v1Gl7Mb99XnhBiVzkne5bdkgmLdnlzzEBPLYnt8zwWHcqxXvIYiDpLQhsVfdkvyYwH1zgrUwAZu08VmY0ax34zxjXJdK68TVs9Y1m7akXkw5/NvIwXk=|635972931146604657|100012|1022|<ENDOFDATA>
The response is usually JSON-encoded:
rfV2ylPLbDbBKEy0yi71xZS/fZbyozd7+smpit1cR8ZeB0qo+stRDttTkCxqF0towkS0bf3lkg4amSbvka6K//QX/F1BHdFNqpkFXQHB9jh2eyR2WgXblKeGRbgw+mma+1P/kKNBtf3qhOUiqOgzONwlTEusiLzqHil6HLTQTKY=|635972681796848020|1066|{"PrivReservedFunds":334.049,"MaxFunds":0.0,"PrivUsedFunds":207.12,"AvailableFunds":126.946}
If there is an error, the server returns an error message starting with XError: for general errors or YError: if there was an error in a subtask of a bulk change order request.
All requests should be made to this endpoint:
31.172.83.53:18017
You must sign messages with your RSA key and provide your signature with all requests:
nonce|userID|requestID|requestData
- nonce: A unique incremental identifier
- userID: A user identifier that appear at section developer on https://fairlay.com/account/
- requestID: The value on parenthesis below at Private API Calls
- requestData: Additional parameters to send with request, could be a number, a string or a JSON.
The signature shoud be digested RSA-SHA512 signature encoded in Base64.
Requests must be send via TCP in the following format:
signature|nonce|userid|requestID|requestData<ENDOFDATA>
Every request must end with <ENDOFDATA>
Remember to use (YOUR API ID*1000)+Request ID on requests. Example: If you create your API accont on Fairlay, site will set an ID to it, usually first API ID is 1. So a request to Get Orderbook with this account will be 1001.
Private API Calls
Get Server Time (2)
Call: signature|nonce|userid|1002
-
Response: signature|nonce|ServerID|ServerTime
636451764120705300
Response: Returns the server's time in ticks.
Note: the server time can also be interfered from the nonce in every response.
Get Me (21)
Call: signature|nonce|userid|1021
-
Response: signature|nonce|ServerID|MeObject
{
"LastConnected":"2018-09-14T20:49:08.6830697Z",
"LastConnectedBal":"2018-09-14T20:49:08.6830697Z",
"UsedWithdrawalAddress":null,
"LMSRMarketMaker":null,
"Disabled":false,
"NoOnHold":false,
"PrivRequests":99995,
"PrivFundsDic":{
"0":{
"PrivTotal":0.1,
"PrivTransfered":0.1,
"PrivExchanged":0.0,
"PrivUsed":0.0
}
},
"Email":blabla@gmail.com,
"Miner":0,
"SettleDel":null,
"APIUsers":{
"0":{
"CanSettleMarkets":false,
"CanChangeTime":false,
"CanDoAdminStuff":false,
"CanDoSpecialRequests":false,
"PrivForceSignature":false,
"PrivForceNonce":false,
"PrivPublicKey":"<RSAKeyValue><Modulus>uiskPc9GqWAdUt1hJ+4VeuxyCNtbs0iY3kSbGQZ7HvwHkCe5H2n9UcX5v1Gl7Mb99XnhBiVzkne5bdkgmLdnlzzEBPLYnt8zwWHcqxXvIYiDpLQhsVfdkvyYwH1zgrUwAZu08VmY0ax34zxjXJdK68TVs9Y1m7akXkw5/NvIwXk=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>",
"DailySpendingLimit":0.0,
"DailySpent":0.0,
"ReadOnly":false,
"TransferOnly":false,
"ID":0
}
},
"PrivForceConfirmMatched":false,
"PrivAbsenceCancelMS":2592000000,
"PrivCBIP":null,
"FailsCB":0,
"Screenname":"blabla",
"ID":100012
}
Returns: User info object with the following information:
- LastConnected - A date with the last connection of the user.
- LastConnectedBal -
- UsedWithdrawalAddress -
- LMSRMarketMaker -
- Disabled - If account is disabled.
- NoOnHold - If user is in or out of the "On Hold" Rule. See FAQ Reserved Fund.
- PrivRequests - Requests remaining before new charge.
- PrivFundsDic - An array with all funding information of the user, containing:
- PrivTotal - Total amount of user cash.
- PrivTransfered -
- PrivExchanged -
- PrivUsed -
- Email - Email of the user.
- Miner -
- SettleDel -
- APIUsers - An array with all API accounts associated with the following information:
- CanSettleMarkets - If this api account can settle markets.
- CanChangeTime - If this api account can change dates in markets.
- CanDoAdminStuff -
- CanDoSpecialRequests - If this API can use transfer or withdrawals operations.
- PrivForceSignature -
- PrivForceNonce -
- PrivPublicKey - A string with a xml containing the public key of this api account.
- DailySpendingLimit - Daily amount limit of betttings of this api account.
- DailySpent - Amount spent in the current day.
- ReadOnly - If this api account is read only and can't modify data.
- TransferOnly - If this api is just for transfer cash.
- ID - Id of the api account.
- PrivForceConfirmMatched -
- PrivAbsenceCancelMS -
- PrivCBIP - Configured ip with the setCallbackIP request which fetch data.
- FailsCB - Callbacks fail counter.
- Screenname - Screen name of the user.
- ID - Id of the user.
Get My Balance (22)
Call: signature|nonce|userid|1022
-
Response: signature|nonce|ServerID|BalanceObject
{
"PrivReservedFunds": 0.1,
"MaxFunds": 0,
"PrivUsedFunds": 0,
"AvailableFunds": 0.1,
"SettleUsed": 0,
"CreatorUsed": 0,
"OnHold": 0,
"RemainingRequests": 99996
}
Returns: JSON object containing account balance information:
- PrivReservedFunds - Total account funds in mBTC.
- MaxFunds -
- PrivUsedFunds - Amount of balance placed on opened markets in mBTC.
- AvailableFunds - Amount of balance available to use in mBTC.
- SettleUsed - Amount retained due to settlement in mBTC.
- CreatorUsed - Amount retained by market creation in mBTC.
- OnHold - Amount retained by fairlay for 24h. See FAQ Reserved Fund.
- RemainingRequests - Requests remaining before new charge.
Set API Account to Readonly (49)
Call: signature|nonce|userid|1049
-
Response: signature|nonce|ServerID|success
"success"
This will permanently set your API Account to Read Only. This cannot be undone.
Returns: A string "success".
Get Orderbook (1)
Call: signature|nonce|userid|1001|marketID
121046999588
Response: signature|nonce|ServerID|OrderbookArray (example with 2 runners)
[
{
"Bids": [ [3.954, 3.75] ],
"Asks": [ [7.203, 2.06156] ],
"S": 1
}, {
"Bids": [ [5.627,2.63] ],
"Asks": [],
"S": 1
}
]
Get the orderbook of a given market with specific ID.
Returns: An Orderbook. See Orderbook
This is a return from a market with 2 runners.
Get Orderbooks (4)
Call: signature|nonce|userid|4|[marketID1, marketID2]
[121046999588, 121046400020]
Response: signature|nonce|ServerID|MarketIDOrderbookDictionary
["121046999588":{
{ "Bids": [ [3.954, 3.75] ],
"Asks": [ [7.203, 2.06156] ],
"S": 1
},{ "Bids": [ [5.627,2.63] ],
"Asks": [],
"S": 1
}
},
"121046400020":{
{ "Bids": [ [3.954, 3.75] ],
"Asks": [ [7.203, 2.06156] ],
"S": 1
},{ "Bids": [ [5.627,2.63] ],
"Asks": [],
"S": 1
}
}
]
Get the orderbook of a many markets with specifics IDs contained in a array.
Returns: A dictionary of market ids associated with its corresponding orderbook. See Orderbook data structure.
Get Market (6)
Call: signature|nonce|userid|1006|marketid
109353571206
Response: signature|nonce|ServerID|market
{
"Comp":"Politics",
"Descr":"Donald Trump shall be president of the United States at 11:59:59 p.m.(ET) on December 31, 2019.",
"Title":"Will Donald Trump be president at year-end 2019?",
"CatID":15,
"ClosD":"2019-12-30T23:00:00",
"SettlD":"2019-12-31T01:00:00",
"Status":0,
"Ru":[
{
"Name":"Yes",
"VisDelay":0,
"RedA":0,
"VolMatched":263.3703784185025
},
{
"Name":"No",
"VisDelay":0,
"RedA":0,
"VolMatched":0
}
],
"_Type":2,
"_Period":1,
"SettlT":0,
"Comm":0.02,
"Settler":{
"1":true,
"777889":true
},
"ComRecip":{
"1":1
},
"MinVal":0,
"MaxVal":0,
"Cur":0,
"CurB":0,
"LastCh":"2018-09-17T20:00:48.1019114Z",
"LastSoftCh":"2018-09-17T20:05:17.9277257Z",
"LogBugs":"",
"OrdBStr":"{\"Bids\":[],\"Asks\":[[1.365,49.2173949315],[1.597,19.94164]],\"S\":1}~"
"Pop":0,
"Margin":10000,
"ID":109353571206
}
Returns: A market object. See Market data structure.
Get Markets (7)
Call: signature|nonce|userid|1007|marketFilters
{
"Cat":0,
"RunnerAND":["Arsenal","Chelsea"],
"TitleAND":null,
"TitleNOT":["Corners","Throwin"],
"Comp":"Premier Leag",
"TypeOR":null,
"PeriodOR":[1],
"SettleOR":null,
"ToSettle":false,
"OnlyMyCreatedMarkets":false,
"Descr":null,
"ChangedAfter":"2016-01-01T22:01:01",
"SoftChangedAfter":"0001-01-01T00:00:00",
"OnlyActive":false,
"MinPop":0.0,
"MaxMargin":103.0,
"NoZombie":false,
"FromClosT":"2016-05-01T00:00:00",
"ToClosT":"0001-01-01T00:00:00",
"FromID":0,
"ToID":100,
"SortPopular":false
}
Response: signature|nonce|ServerID|markets
[
{
"Comp":"England - Premier League",
"Descr":"Match",
"Title":"Cardiff City vs. Arsenal",
"CatID":1,
"ClosD":"2018-09-02T12:30:00Z",
"SettlD":"2018-09-02T14:30:00Z",
"Status":4,
"Ru":[
{
"Name":"Cardiff City",
"VisDelay":6000,
"RedA":0,
"VolMatched":64.27775
},
{
"Name":"Arsenal",
"VisDelay":6000,
"RedA":0,
"VolMatched":0
},
{
"Name":"Draw",
"VisDelay":6000,
"RedA":0,
"VolMatched":0
}
],
"_Type":0,
"_Period":1,
"SettlT":0,
"Comm":0.0025,
"Settler":{
"1":true,
"777555":true,
"777889":true
},
"ComRecip":{
"777555":0.5,
"1011849":0.5
},
"MinVal":0,
"MaxVal":0,
"Cur":0,
"CurB":0,
"LastCh":"2018-09-02T14:39:08.8189277Z",
"LastSoftCh":"2018-09-02T14:39:08.8189277Z",
"LogBugs":"",
"OrdBStr":"",
"Pop":12,
"Margin":10000,
"ID":146318670899
},
{
"Comp":"England - Premier League",
"Descr":"Match",
"Title":"Newcastle United vs. Arsenal",
"CatID":1,
"ClosD":"2018-09-15T14:00:00Z",
"SettlD":"2018-09-15T16:00:00Z",
"Status":4,
"Ru":[
{
"Name":"Newcastle United",
"VisDelay":6000,
"RedA":0,
"VolMatched":214
},
{
"Name":"Arsenal",
"VisDelay":6000,
"RedA":0,
"VolMatched":0
},
{
"Name":"Draw",
"VisDelay":6000,
"RedA":0,
"VolMatched":0
}
],
"_Type":0,
"_Period":1,
"SettlT":0,
"Comm":0.0025,
"Settler":{
"1":true,
"777555":true,
"777889":true
},
"ComRecip":{
"777555":0.5,
"1011849":0.5
},
"MinVal":0,
"MaxVal":0,
"Cur":0,
"CurB":0,
"LastCh":"2018-09-15T16:10:27.8171808Z",
"LastSoftCh":"2018-09-15T16:10:27.8171808Z",
"LogBugs":"",
"OrdBStr":"",
"Pop":12,
"Margin":10000,
"ID":146814296539
}
]
Get all markets that satisfies the following filters:
- Cat - Category, 0 queries all Categories. (See Categories).
- RunnerAND - An array with all strings that must be contained in the names of the runners of the market.
- TitleAND - An array with all strings that must be contained in the title of the market.
- TitleNOT - None of the strings may appear in the title of the market.
- Comp - Competition of the market.
- TypeOr - Only the Market Types given will be returned. If set to null, all market types will be returned. (See Types)
- PeriodOr - Similiar to TypeOr See Periods.
- SettleOr - See Settlements.
- ToSettle - If set to true, it will only return unsettled markets where the resolution time has passed.
- OnlyMyCreatedMarkets - Return just markets created by me.
- Descr - The given string must appear in the market description.
- ChangedAfter - Only returns markets, where the meta data was changed after the given date. Usually the Closing and Settlement Dates of a market is the only data that changes.
- SoftChangedAfter - Returns all markets, where either the the meta data or the orderbook has changed since the given date.
- OnlyActive - List only active markets.
- MinPop -
- MaxMargin -
- NoZombie - No empty markets (without any open order).
- FromClosT - List markets with close dates greater than this.
- ToClosT - List markets with close dates lower than this.
- FromID - List markets with ids greater than this.
- ToID - List markets with ids lower than this.
- SortPopular - Order by popularity.
Returns: An array of all market objects that apply to the given filter. See Market structure.
Get Markets Orderbook (67)
Call: signature|nonce|userid|1067|marketFilters
{
"Cat":0,
"RunnerAND":["Arsenal","Chelsea"],
"TitleAND":null,
"TitleNOT":["Corners","Throwin"],
"Comp":"Premier Leag",
"TypeOR":null,
"PeriodOR":[1],
"SettleOR":null,
"ToSettle":false,
"OnlyMyCreatedMarkets":false,
"Descr":null,
"ChangedAfter":"2016-01-01T22:01:01",
"SoftChangedAfter":"0001-01-01T00:00:00",
"OnlyActive":false,
"MinPop":0.0,
"MaxMargin":103.0,
"NoZombie":false,
"FromClosT":"2016-05-01T00:00:00",
"ToClosT":"0001-01-01T00:00:00",
"FromID":0,
"ToID":100,
"SortPopular":false
}
Response: signature|nonce|ServerID|marketIDOrderbookDictionary
["121046999588":{
{ "Bids": [ [3.954, 3.75] ],
"Asks": [ [7.203, 2.06156] ],
"S": 1
},{ "Bids": [ [5.627,2.63] ],
"Asks": [],
"S": 1
}
},
"121046400020":{
{ "Bids": [ [3.954, 3.75] ],
"Asks": [ [7.203, 2.06156] ],
"S": 1
},{ "Bids": [ [5.627,2.63] ],
"Asks": [],
"S": 1
}
}
]
Get all market orderbooks that satisfies your filters. Filters are the same as Get Market:
Returns: A dictionary of market id associated with its corresponding orderbook. Same structure as Get Orderbooks
Create Market (11)
Call: signature|nonce|userid|1011|marketData
{
"Comp":"Politics",
"Descr":"This market resolves to Yes, if the Senate confirms Merrick Garland’s Supreme Court nomination before President Obama leaves the office.",
"CatID":15,
"ClosD":"2016-11-01T00:00:00",
"SettlD":"2017-01-20T00:00:00",
"Ru":
[
{
"Name":"Yes",
"InvDelay":0,
"VisDelay":6000
},{
"Name":"No",
"InvDelay":0,
"VisDelay":6000
}
],
"_Type":2,
"_Period":1,
"SettlT":0,
"Comm":0.02,
"PrivCreator":784741,
"CreatorName":"USERNAME"
}
Response: signature|nonce|ServerID|marketid
121046400020
Create a market with the following data:
- Comp - Competition.
- CatID - Category (see Categories).
- ClosD - Closing Date.
- SettlD - Resolution Date.
- Ru - An array representing all market runners with the structure:
- Name - Name of the runner.
- InvDelay - Must always be 0.
- VisDelay - Maximum allowed time to void orders on this runner. Usually is 6000.
- _Type - See Type.
- _Period - See Periods.
- SettlT - For settlement types see Settlements.
- Comm - Must always be 0.02.
- PrivCreator - Must match your userid and will remain private.
- CreatorName - Must match your Username and is public.
Returns: The created market id.
Create Order (62)
Call: signature|nonce|userid|1062|marketid|runnerid| bidorask|price|amount|type|matchesubuser|pendingperiod
71601335718|0|1|1.56|100.1|2|testorder|6000
Response: signature|nonce|ServerID|UnmatchedOrderObject
{
"Price":1.04,
"RemAmount":0.05,
"State":0,
"BidOrAsk":0,
"PrivAmount":0.05,
"PrivSubUser":"balanceorder",
"PrivCancelAt":3155378975999999999,
"makerCT":0,
"_Type":0,
"PrivID":633728772777882209,
"PrivUserID":1132152
}
Create an order with the following information:
- marketid - On which market the order will be placed.
- runnerid - On which runner the order will be placed: 0 for the 1st runner, 1 for the 2nd runner of the market and so on.
- bidorask - 0 places a bid order, against the runner. 1 places a bet on the runner to win.
- price - The decimal odds at which the order is placed.
- amount - The amount in mBTC.
- matchedsubuser - Custom string.
- type - See unmatched order types in Order Types.
- pendingperiod - Should be set to 6000.
Obs:. Regarding Binary Markets, liability is a relation between stake (amount) and odds (price), while in the Fairlay website the stake (amount) is the liablity directly.
Returns: A Unmatched Order Object. See Unmatched Order Object for details.
Cancel Order (15)
Call: signature|nonce|userid|1015|marketid|runnerid|orderid
71601335718|0|636728772330883209
Response: signature|nonce|ServerID|cancelledOrderList
IN PROGRESS (call)
Cancel orders that matches:
- marketid - Market ID.
- runnerid - Runner ID.
- orderid - Order ID.
Returns: a list of all corresponding matched order objects for the cancelled unmatched order.
Cancel Market Orders (10)
Call: signature|nonce|userid|1010|marketID
71601335718
Response: signature|nonce|ServerID|stringResponse
'2 Orders were cancelled'
Cancel all opened orders on specific market, with the market id equals to marketID.
Returns: A string containing how many unmatched orders were cancelled.
Cancel All Orders (16)
Call: signature|nonce|userid|1016
-
Response: signature|nonce|ServerID|stringResponse
'5 Orders were cancelled'
Cancel all user orders.
Returns: A string containing how many unmatched orders were cancelled.
Change Order (17)
Call: signature|nonce|userid|1017|marketid|runnerid|orderid|price|amount
71601335718|0|636728772330883209|1.56|100.1
Response: signature|nonce|ServerID|unmatchedOrder
{
"Price":1.07,
"RemAmount":0.03,
"State":0,
"BidOrAsk":0,
"PrivAmount":0.05,
"PrivSubUser":"balanceorder",
"PrivCancelAt":3155378975999999999,
"makerCT":0,
"_Type":0,
"PrivID":633728772777882209,
"PrivUserID":1132152
} IN PROGRESS (call)
Is a combination of "cancel order" and "create order"
- marketid - On which market the order will be placed.
- runnerid - On which runner the order will be placed: 0 for the 1st runner, 1 for the 2nd runner of the market and so on.
- orderid - Order id of the order that will be changed.
- price - The decimal odds at which the order is placed.
- amount - The amount in mBTC.
Returns: An Unmatched Order Object. See Unmatched Order Object for details.
Bulk Change Order Maker (109)
Call: signature|nonce|userid|1109|RequestChangeOrderArray
[
{
"Am": "2.00",
"Pri": "1.537",
"Boa": 1,
"Type": 2,
"Mid": 149972421088,
"Rid": 0,
"LayAsL": false,
"CAt": 0,
"Mct": 0,
"Oid": -1
}
]
Response: signature|nonce|ServerID|REQChangeOrderArray
[
{
"Mid":149972421088,
"Rid":0,
"Oid":-1,
"Am":2.00,
"Pri":1.537,
"Sub":null,
"Type":2,
"Boa":1,
"Mct":0,
"LayAsL":false,
"CAt":0,
"Res":"{\"Price\":1.537,\"RemAmount\":0.0,\"State\":1,\"BidOrAsk\":1,\"PrivAmount\":2.00,\"PrivSubUser\":null,\"PrivCancelAt\":3155378975999999999,\"makerCT\":0,\"_Type\":2,\"PrivID\":636741074031960092,\"PrivUserID\":1007510}"
}
]
Changes, cancels and creates many orders at once. Pass a Request Change Order Array with the following:
- Mid - Market id of the order.
- Rid - Runner id of the order.
- Oid - Order id.
- Am - Amount of the order.
- Pri - Price of the order.
- Sub - Custom text for user reference.
- Type - Order type. See Order Types.
- Boa - Bid or Ask. 0 for Bids and 1 for Asks.
- Mct - This is the Maker cancel time. How much time you have as maker of the bet to void the bet after the intial matching.
- LayAsL - If you like to have the amount as liability of the order if you place a bid order on a binary market.
- CAt - Order will be cancelled at this time in Ticks in UTC. If it's below the current time in ticks, the order won't be created. Set Mct to 0 to use it.
Returns: An array of REQChangeOrder objects. Each array element contains the same structure of the call plus the attribute Res.
- Res - An Unmatched Order Object, ( See Unmatched Order Object for details.) or an YError string. Important: This object is encoded in a string.
Get New Orders (24)
Call: signature|nonce|userid|1024|timeinticks
636729639366023200
Response: signature|nonce|ServerID|orders
{
"TimeStamp":636729639366023200,
"UnMatched":
[
{
"_UserOrder":
{
"BidOrAsk":0,
"MarketID":148678516313,
"RunnerID":1,
"OrderID":636729633911939100,
"MatchedSubUser":null
},
"_UnmatchedOrder":
{
"Price":1.04,
"RemAmount":0.02,
"State":0,
"BidOrAsk":0,
"PrivAmount":0.02,
"PrivSubUser":"balanceorder",
"PrivCancelAt":3155378976000000000,
"makerCT":0,
"_Type":0,
"PrivID":636729633911939100,
"PrivUserID":1032152
}
}
],
"Matched":
[
{
"_UserOrder":
{
"BidOrAsk":0,
"MarketID":148678516313,
"RunnerID":1,
"OrderID":"636729682302455151",
"MatchedSubUser":"balanceorder"
},
"_MatchedOrder":
{
"Price":1.04,
"Amount":0.02,
"Red":0,
"DecResult":0,
"R":0,
"ID":"636729682302455151",
"State":0,
"MakerCancelTime":0
},
"_UserUMOrderID":"636729633911939057"
}
]
}
Get all orders after timeinticks.
Returns: All user unmatched orders and matched orders that were created, cancelled or changed after the given time, with the following structure:
- TimeStamp - The timestamp in ticks that user searched for.
- UnMatched - An array containing all unmatching orders. See Get Unmatched Orders Return to know the structure.
- Matched - An array containing all matching orders. See Get Matched Orders Return to know the structure.
Get Unmatched Orders (25)
Call: signature|nonce|userid|1025|timeinticks
636451764120705300
Response: signature|nonce|ServerID|orders
[
{
"_UserOrder":
{
"BidOrAsk":0,
"MarketID":148678778313,
"RunnerID":1,
"OrderID":"636728772330883209",
"MatchedSubUser":null
},
"_UnmatchedOrder":
{
"Price":1.04,
"RemAmount":0.05,
"State":0,
"BidOrAsk":0,
"PrivAmount":0.05,
"PrivSubUser":"balanceorder",
"PrivCancelAt":"3155378975999999999",
"makerCT":0,
"_Type":0,
"PrivID":"636728772330883209",
"PrivUserID":1043252
}
}
]
Get all user unmatched orders after timeinticks.
Returns: An array containing all user unmatched orders that were created, cancelled or changed after the given time. Each array element is made of an UserOrderObject and a UnmatchedOrderObject.
- UserOrderObject - To see about it, look at User Order Object.
- UnmatchedOrderObject - To see about it, look at Unmatched Order Object.
Get Matched Orders (27)
Call: signature|nonce|userid|1025|timeinticks
636451764120705300
Response: signature|nonce|ServerID|orders
[
{
"_UserOrder":
{
"BidOrAsk":0,
"MarketID":148678516313,
"RunnerID":1,
"OrderID":"636729682302455151",
"MatchedSubUser":"balanceorder"
},
"_MatchedOrder":
{
"Price":1.04,
"Amount":0.02,
"Red":0,
"DecResult":0,
"R":0,
"ID":"636729682302455151",
"State":0,
"MakerCancelTime":0
},
"_UserUMOrderID":"636729633911939057"
}
]
Get all user matched orders after timeinticks.
Returns: An array containing all user matched orders that were created, cancelled or changed after the given time. Each array element is made of:
- UserOrderObject - To see about it, look at User Order Object.
- MatchedOrderObject - To see about it, look at Matched Order Object.
- _UserUMOrderID - Id of the order as Unmatched Order Object, before become a matched order. TODO
Transfer Founds/Withdraw (81)
Call: signature|nonce|userid|1081|transferobject
{
"FromU": 1002307,
"ToU": 111111,
"Cur": 0,
"Descr": "1QDr7soMdj4SEiD8aCpbDTHAqV23VcGyZA;0.4",
"TType": 2,
"Amount": 3000.4
}
Response: signature|nonce|ServerID|transferedObject
{
"Cur":0,
"ID2":118437536700,
"FromU":1002307,
"ToU":111111,
"Descr":"1QDr7soMdj4SEiD8aCpbDTHAqV23VcGyZA;0.4",
"TType":2,
"Amount":3000.4
}
- FromU: Must match your userid.
- ToU - Must be an existing userid.
- Descr - Description.
- TType - 0-99 stands for a transfer, includes deposits & cashouts, 100 admin, 200 market settlement w/o commission, 201 market settlement with commission, 250 unsettlement, 300 commission bonus).
- Amount - Amount to be transfered.
Returns: If successful, returns the same object sent plus an atribute ID2:
- ID2 - It's the transaction id.
Get User Transaction (82)
Call: signature|nonce|userid|1082|timeinticks
636451764120705300
Response: signature|nonce|ServerID|transactionArray
[
{
"Cur":0,
"ID2":116885599551,
"FromU":1006092,
"ToU":1012052,
"Descr":"API test",
"TType":3,
"Amount":0.1
}
]
Get all user transactions since given timeinticks.
Returns: An array of transactions with the following structure:
- Cur - See Currency Types.
- ID2 -
- FromU - Origin user id of that transaction.
- ToU - Destination user id of that transaction.
- Descr - Custom description.
- TType - 0-99 stands for a transfer, includes deposits & cashouts, 100 admin, 200 market settlement w/o commission, 201 market settlement with commission, 250 unsettlement, 300 commission bonus).
- Amount - Amount of the transaction.
Set Market Maker (73)
Call: signature|nonce|userid|1073|lmsrmarketmakerobject
{
"UserID":777888,
"MarketID":76650963889
"Runner":5,
"Enabled":true,
"InitShareLimit":350.0,
"B":1300.0,
"CancelAll":"2016-06-05T13:34:56",
"ShareStop":1400.0,
"InitProb":[0.3,0.1,0.2,0.2,0.2],
"DiminishBack":[0.01,0.01,0.01,0.0,0.02],
"DiminishLay":[0.0,0.0,0.0,0.01,0.01],
"coolOffSeconds":36000.0,
"coolOffFactor":4.0
}
Response: signature|nonce|ServerID
IN PROGRESS (result)
This sets up an fully automated LMSR market maker. Google the term to get familiar with the usage.
- UserID - Must match your userid. Default value your userid.
- MarketID - Chosen market id.
- Runner - Quantity of Runners, must match the quantity of market runners. Default value 5.
- Enabled - Must be set to true. Default value True.
- InitShareLimit - Must be greater than 1. Shares that are offered in one order. Stake + Winnings from one order are 350mBTC. Default value 300.
- B - Must be greater than 10. Is about the same as the maximum possible loss of the market maker. Default value 1000.
- CancelAll - Must be set to a future date. Date where the market maker stops. Set to year 2100 if the mm should run forever. Default value "2016-06-05T13:34:56".
- ShareStop - Must be greater than 1. Amount of exposure in shares before the market maker stops. Should be set higher than B in regular cases. Default value 9999.
- InitProb - The initial probability estimation for all runners. Default value [0.2,0.2,0.2,0.2,0.2].
- DiminishBack - Must be non-negative. In general the LMSR market maker runs on 0% margin, i.e. it doesn't make any profit. If more margin should be added, you can worsen the odds for each bid orders for every runner. 0.01 worsens bid odds from 80% to 81% (or 1.25 to 1.2345) for example. Default value [0,0,0,0,0].
- DiminishLay - Same for all ask orders. Default value [0.01,0.01,0.01,0.01,0.01].
Cool off adds temporary additional margin to markets with increased activity and should be applied to markets that can have exogenous shocks or where real probabilities can deviate from the initial probability distribution.
- coolOffSeconds - Must be greater or equal to 1. The time after which the coolOff period will be over. If set to 36000 the additional market margin will reduce step by step over an period of 10 hours. If no cool off is required, set coolOffSeconds to 1. Default value 1.
- coolOffFactor - Must be greater or equal to 1. if set to 4.0 the odds will worsen 4.0 times more than expected from the usual lmsr market maker. Default value 2.
Disable a MM by setting Enabled = false and other variables to a valid value.
Get Market Maker (70)
Call: signature|nonce|userid|1070|marketid
61659266392
Response: signature|nonce|ServerID|lmsrmarketmakerobject
{
"UserID":777888,
"MarketID":61659266392,
"Runner":5,
"Enabled":true,
"InitShareLimit":350.0,
"B":1300.0,
"CancelAll":"2016-06-05T13:34:56",
"ShareStop":1400.0,
"InitProb":[0.3,0.1,0.2,0.2,0.2],
"DiminishBack":[0.01,0.01,0.01,0.0,0.02],
"DiminishLay":[0.0,0.0,0.0,0.01,0.01],
"coolOffSeconds":36000.0,
"coolOffFactor":4.0
}
Gets the current LMSR MM from the user for a given market with market id equals to marketid.
Returns: An lmsr market maker object with the following data:
- UserID - User id of the market maker.
- MarketID - Market id of the market maker.
- Runner - Number of runners of the market maker.
- Enabled - If the market maker is enabled.
- InitShareLimit - Shares that are offered in one order.
- B - Is about the same as the maximum possible loss of the market maker.
- CancelAll - Date where the market maker stops.
- ShareStop - Amount of exposure in shares before the market maker stops.
- InitProb - The initial probability estimation for all runners.
- DiminishBack - In general the LMSR market maker runs on 0% margin, i.e. it doesn't make any profit. If more margin should be added, you can worsen the odds for each bid orders for every runner. 0.01 worsens bid odds from 80% to 81% (or 1.25 to 1.2345) for example.
- DiminishLay - Same for all ask orders.
- coolOffSeconds - The time after which the coolOff period will be over.
- coolOffFactor - If set to 4.0 the odds will worsen 4.0 times more than expected from the usual lmsr market maker.
Change Market Closing Time (84)
Changes Closing and Settlement Date
Call: signature|nonce|userid|1084|ChangeTimeObject
{
"MID":76650963889,
"ClosD":"2016-06-11T01:00:00Z",
"SetlD":"2016-06-11T03:00:00Z"
}
Response: signature|nonce|ServerID|marketTimeChanged
IN PROGRESS (precondition)
Change the market closing time.
- MID - Market id of the market which will change.
- ClosD - New close date of the market.
- SetlD - New Settlement Date of the market.
Returns: MarketTime changed.
Get Statements (85)
Call: signature|nonce|userid|1085|timeinticks
636451764120705300
Response: signature|nonce|ServerID|statement
[
{
"ID":85349599553,
"Descr":"API test",
"T":3,
"Am":0.1,
"Bank":0.1,
"Cur":0
}
]
Gets all bankroll adjustments after a given time.
Returns: An array of statement Object:
- ID - Is not unique globally, is the time in milliseconds from Jan 1th 2016.
- Descr - Optional description, contains the market ID in case of a settlement.
- T - 0-99 stands for a transfer (same like ttype in transfer object) includes deposits & cashouts, 100 admin, 200 market settlement w/o commission, 201 market settlement with commission, 250 unsettlement, 300 commission bonus).
- Am - Amount credited.
- Bank - Total bankroll after the adjustment.
- Cur - Currency. See Currency Types.
Settle Market (86)
Call: signature|nonce|userid|1086|SettleRequestObject
{
"Mid":77588905280,
"Runner":0,
"Win":1,
"Half":false,
"Dec":0.0,
"ORed":0.0
}
Response: signature|nonce|ServerID|stringResponse
"Market settled"
Settles a given market. Note that the total betting volume of the market will be deducted from the available balance for 2 to 3 days. Unless the user has special rights, a user can only settle markets he created.
- Mid - Is the market ID.
- Runner - Determines the Runner which won (0 means that the 1st Runner won, 1 means that the 2nd Runner won and so on). If a market shall be voided the Runner must be set to -1.
- Win - Must be set to 1.
- Half - Should be set to "false". Only needed for +- 0.25 and +-0.75 soccer spread and over/under markets. If a market is half won or half lost, set Half to "true".
- Dec - If the market is not binary, but has a decimal outcome, this needs to be set to the result. [Not supported yet].
- ORed - Odds reduction [only for Horse racing - not needed in general].
Returns: A string "Market settled" in case of confirmation or an type of "XError", otherwise.
Data Types
Market
{
"Comp":"Politics",
"Descr":"Donald Trump shall be president of the United States at 11:59:59 p.m.(ET) on December 31, 2019.",
"Title":"Will Donald Trump be president at year-end 2019?",
"CatID":15,
"ClosD":"2019-12-30T23:00:00",
"SettlD":"2019-12-31T01:00:00",
"Status":0,
"Ru":[
{
"Name":"Yes",
"VisDelay":0,
"RedA":0,
"VolMatched":263.3703784185025
},
{
"Name":"No",
"VisDelay":0,
"RedA":0,
"VolMatched":0
}
],
"_Type":2,
"_Period":1,
"SettlT":0,
"Comm":0.02,
"Settler":{
"1":true,
"777889":true
},
"ComRecip":{
"1":1
},
"MinVal":0,
"MaxVal":0,
"Cur":0,
"CurB":0,
"LastCh":"2018-09-17T20:00:48.1019114Z",
"LastSoftCh":"2018-09-17T20:05:17.9277257Z",
"LogBugs":"",
"OrdBStr":"{\"Bids\":[],\"Asks\":[[1.365,49.2173949315],[1.597,19.94164]],\"S\":1}~"
"Pop":0,
"Margin":10000,
"ID":109353571206
}
Object that hold a market data structure:
- Comp - Competition of the market.
- Descr - Description of the market.
- Title - Title of the market.
- CatID - Category of the market. See Categories
- ClosD - Close date of the market.
- SettlD - Settle date of the market.
- Status - See Market Status.
- Ru - A list of runners of the market, with the following structure:
- Name - Name of the runner.
- VisDelay - Maximum allowed time to void orders on this runner. Usually is 6000.
- RedA -
- VolMatched - Total amount matched on this runner.
- _Type - Market type. See Types
- _Period - Market period. See Periods
- SettlT - Market settlement type. See Settlement Types
- Comm - Comission of the market.
- Settler - Determines all allowed Settler for this market and if they are trusted or not. Untrusted settlers may settle the market, but have to put in the entire volume as Security deposit for 3 days. In order for a market to be listed as safe on Fairlay.com, the user "1" (Fairlay) has to be put in as trusted settler and the user 777889 has also to be put in as settler for faster settlement, all other settlers have to be untrusted. Any defined settler may determine "settle delegates" who may settle markets in their name, but whose settlement can be overturned.
- ComRecip - Determines all users, who receive the commission of the market. In order to be listed on the Fairlay.com website, the user 1 (Fairlay) has to receive at least 50% (0.5).
- MinVal - Minimum value which you can pay for a bet.
- MaxVal - Minimum value which you can pay for a bet.
- Cur - Market currency. See Currency Types.
- CurB - For exchange markets. The destination currency.
- LastCh - Last change on market, covers everything.
- LastSoftCh - Last change on market, covers relevant attributes which may interfere on bets.
- LogBugs -
- OrdBStr - Market Orderbook. See Orderbook data structure. Important: This object is encoded in a string.
- Pop -
- Margin -
- ID - Id of the market.
Orderbook
[
{
"Bids": [ [3.954, 3.75] ],
"Asks": [ [7.203, 2.06156] ],
"S": 1
}, {
"Bids": [ [5.627,2.63] ],
"Asks": [],
"S": 1
}
]
An array of objects that hold orders for each runner in market with the following structure:
- Bids - Array of bids on that runner. Each bid has two values: First price and second amount.
- Asks - Array of asks on that runner. Each ask has two values: First price and second amount.
- S -
Market Category
MARKET_CATEGORY = {
1: 'Soccer',
2: 'Tenis',
3: 'Golf',
4: 'Cricket',
5: 'RugbyUnion',
6: 'Boxing',
7: 'Horse Racing',
8: 'Motorsport',
10: 'Special',
11: 'Rugby League',
12: 'Bascketball',
13: 'American Football',
14: 'Baseball',
15: 'Politics',
16: 'Financial',
17: 'Greyhound',
18: 'Volleyball',
19: 'Handball',
20: 'Darts',
21: 'Bandy',
22: 'Winter Sports',
24: 'Bowls',
25: 'Pool',
26: 'Snooker',
27: 'Table tennis',
28: 'Chess',
30: 'Hockey',
31: 'Fun',
32: 'eSports',
33: 'Inplay',
34: 'reserved4',
35: 'Mixed Martial Arts',
36: 'reserved6',
37: 'reserved',
38: 'Cycling',
39: 'reserved9',
40: 'Bitcoin',
42: 'Badminton'
}
The main categories for diverse market options, use their IDs to filter market by category:
There's no need to special explanation of each type.
Types with keyword reserved don't represent real categories for now, but can in the future.
Market Status
MARKET_STATUS = {
0: "ACTIVE",
1: "INPLAY",
2: "SUSPENDED",
3: "CLOSED",
4: "SETTLED",
5: "CANCELLED"
}
Different market status:
- ACTIVE: Usual market with betting allowed.
- INPLAY: Live market, with the corresponding event ocurring while you can bet.
- SUSPENDED: Paused market, can return to active or inplay again.
- CLOSED: Market closed, no more bets allowed, waiting to settle.
- SETTLED: Market resolved, all winners/losers processed.
- CANCELLED: Market definitely closed, no winners, everyone get their cash back.
Market Type
MARKET_TYPE = {
0: 'MONEYLINE',
1: 'OVER_UNDER',
2: 'OUTRIGHT',
3: 'GAMESPREAD',
4: 'SETSPREAD',
5: 'CORRECT_SCORE',
6: 'FUTURE',
7: 'BASICPREDICTION',
8: 'RESERVED2',
9: 'RESERVED3',
10: 'RESERVED4',
11: 'RESERVED5',
12: 'RESERVED6'
}
Different types of market rules settlement:
- MONEYLINE: Simple bet on the outcome of a game/event.
- OVER_UNDER: A bet if some numerical statistic will be over or under a specific value.
- OUTRIGHT: A long time bet over a sequence of events that will lead in a final result, the winner of a competition for example.
- GAMESPREAD: Each player has a prediction on how good they will perform, this act like odds, you bet if along all games he will perform better or worse than what was expected.
- SETSPREAD: This is exclusive to tennis. Same as Game Spread, but rather than many games performance, the performance is about sets in a single game.
- CORRECT_SCORE: A bet on an exact value of a game.
- FUTURE: Decimal market where you bet if an asset will rise or fall in value.
- BASICPREDICTION:
Types with keyword reserved don't represent real types for now, but can in the future.
Market Periods
MARKET_PERIOD = {
0: 'UNDEFINED',
1: 'FT',
2: 'FIRST_SET',
3: 'SECOND_SET',
4: 'THIRD_SET',
5: 'FOURTH_SET',
6: 'FIFTH_SET',
7: 'FIRST_HALF',
8: 'SECOND_HALF',
9: 'FIRST_QUARTER',
10: 'SECOND_QUARTER',
11: 'THIRD_QUARTER',
12: 'FOURTH_QUARTER',
13: 'FIRST_PERIOD',
14: 'SECOND_PERIOD',
15: 'THIRD_PERIOD',
}
Mostly used by sports markets, define if the market is related to a specific fraction of the match:
Market Settlements
MARKET_SETTLEMENT = {
0: 'BINARY',
1: 'CFD',
2: 'CFDI',
3: 'EXCHANGE'
}
Different types of markets settlement:
- Binary: One runner win, other loses. Bets are placed using Odds ON and AGAINST outcomes.
- CFD: Is a Contract for Difference, users buy portions of contracts that will receive a value when market will be settled. Prices range from 0 to 1.
- CFDI: Is a Contract for Difference, users buy portions of contracts that will receive a value when market will be settled. Prices could have any kind of range, an example could be a Future bitcoin market that has minimum price from 6000USD and a maximum of 12000USD.
- EXCHANGE: Every matched orders is settled instantly with the filled amount, and a exchange of currency is made.
Currency Types
CURRENCY_TYPE = {
0: 'mBTC',
1: 'mETH',
2: 'mLTC',
3: 'mDash',
4: 'mBCH'
}
Different types of currencies accepted:
- mBTC: Mili Bitcoin.
- mETH: Mili Ethereum.
- mLTC: Mili LiteCoin.
- mDash: Mili Dash.
- mBCH: Mili Bitcoin Cash.
Matched order state
MATCHED_ORDER_STATE = {
0: 'MATCHED',
1: 'RUNNER_WON',
2: 'RUNNER_HALFWON',
3: 'RUNNER_LOST',
4: 'RUNNER_HALFLOST',
5: 'MAKERVOIDED',
6: 'VOIDED',
7: 'PENDING',
8: 'DECIMAL_RESULT'
}
States of an order could have during its lifetime:
- PENDING: When two Unmatched Order Objects are matched, and then a Matched Order Object is created, it will be in the PENDING state.
- MATCHED: After pending, this order while not resolved is matched.
- RUNNER_WON: Market settled and this runner won.
- RUNNER_HALFWON: Market settled and this runner partially won.
- RUNNER_LOST: Market settled and this runner lost.
- RUNNER_HALFLOST: Market settled and this runner partially lost.
- MAKERVOIDED: The matched order owner voided its order.
- VOIDED: You, as maker, voided your order, or Market was settled and your order was still unmatched.
- DECIMAL_RESULT: Special result for exchange markets.
Unmatched Order Object
{
"Price":1.04,
"RemAmount":0.05,
"State":0,
"BidOrAsk":0,
"PrivAmount":0.05,
"PrivSubUser":"balanceorder",
"PrivCancelAt":3155378975999999999,
"makerCT":0,
"_Type":0,
"PrivID":633728772777882209,
"PrivUserID":1132152
}
A object that represent a unmatched order:
- Price - The decimal odds at which the order is placed.
- RemAmount - Amount of the order still not matched.
- _Type - See unmatched order types in Order Types.
- State - See unmatched order status in Unmatched Order States.
- BidOrAsk - 0 means bid order, against runner, and 1 means ask order, in favor of runner.
- PrivAmount - Total amount of the order.
- PrivCancelAt - Tick time when order will be automatically cancelled.
- PrivID - Created order id.
- PrivSubUser - Custom string chosen by user on call.
- makerCT - Time in milisseconds you have to void this order after a match.
- PrivUserID - User id that created the order.
Matched Order Object
{
"Price":1.04,
"Amount":0.02,
"Red":0,
"DecResult":0,
"R":0,
"ID":"636729682302455151",
"State":0,
"MakerCancelTime":0
}
An object representing matching data, with the following structure:
- Price - Price of the matched order.
- Amount - Amount matched.
- Red - TODO
- DecResult - This is the result of an order in a settled decimal market.
- R -
- ID - Matched order id.
- State - State of matched order. See Matched Order States.
- MakerCancelTime - Time in milisseconds you have to void this order. Every time you exerts your right to (maker)void a bet, a fee is deducted from your account. This fee is currently 300 requests or 0.003mBTC but will be increased if needed.
Unmatched Order State
UNMATCHED_ORDER_STATE = {
0: 'ACTIVE',
1: 'CANCELLED',
2: 'MATCHED',
3: 'MATCHEDANDCANCELLED'
}
States of unmatched order could have during its lifetime:
- ACTIVE: Active order waiting for a match.
- CANCELLED: Voided order.
- MATCHED: This unmatched object order is already associated with another through a matched order.
- MATCHEDANDCANCELLED: This unmatched object order is already associated with another through a matched order, but they were voided.
User Order Object
{
"BidOrAsk":0,
"MarketID":148678778313,
"RunnerID":1,
"OrderID":"636728772330883209",
"MatchedSubUser":null
}
Is an object with:
- BidOrAsk - 0 means bid order, against runner, and 1 means ask order, in favor of runner.
- MarketID - Market id of the order.
- RunnerID - Runner id of the order.
- OrderID - Order id.
- MatchedSubUser - Custom string chosen by the user for the order.
Order type
ORDER_TYPE = {
0: 'MAKERTAKER',
1: 'MAKER',
2: 'TAKER'
}
Different types of order that is created:
- MAKERTAKER: If not matched instantly, will remain in the orderbook.
- MAKER: Will be placed at orderbook waiting for a match.
- TAKER: If not fully matched instantly, the amount unmatched will be voided automatically.
Public API Introduction
This is a free service to scrape all markets on Fairlay. For all POST requests (creating/changing markets and orders) use the paid Private API.
- The data on the free servers is updated every 5 seconds
- For Professional Users there exist private servers with an update frequency of half a * second. Please contact [email protected] to get access.
- You have to accept GZIP, DEFLATE in your HEADER
- Use the SoftChangedAfter parameter for incremental calls. Retrieve the server time and only query markets that have changed after your last request
- 12 incremental calls are allowed per minute (the SoftChangedAfter parameter must be set to not more than 30 seconds in the past)
- 1 call without a proper SoftChangedAfter parameter is allowed per IP per minute
- When using the markets request make sure that your URI is not too long
- All times are UTC (like DateTime.UtcNow, to account for any time difference with your developer machine grab Server Time, in the C# API all calls other than time will do this automatically for you)
- Strings are not case sensitive
For more examples how this API should be used together with our paid API, please take a look at our sample clients in C# and Python.
Please feel free to comment and make suggestions.
Free Servers
http://31.172.83.181:8080
used by default for all Public API calls
http://31.172.83.53:8080
(is an alternate server with the same functionality, also used for all Private API calls)
For examples on how to use each of the API calls presented here, see the C# Unit Tests.
In all of the examples below you can call /free/(method) calls with /free0/ up to /free9/ to increase the given limits above, a simple way is to either rotate from 1 to 9 or just randomize the free call from 1 to 9.
Server Time
Call:
http://31.172.83.181:8080/free/time
Response:
636728043453486318
Returns the server time in ticks.
Note: You can do the same in the Private API via getservertime
Markets
Returns JSON encoded list of markets that apply to the given filter.
Call:
http://31.172.83.181:8080/free/markets/JSON-ENCODED-MARKETFILTER
Examples:
Returns the first 100 non-empty soccer markets, where one of the runners is Portugal, the Title does not contain the words "Corners" or "Throwin" and the period of the match is full-time.
http://31.172.83.181:8080/free/markets/{"Cat":1,"NoZombie":true,"RunnerAND":["Portugal"], "TitleNOT":["Corners","Throwin"], "PeriodOR":[1],"FromID":0,"ToID":100}
Returns all active tennis matches of the type Over/Under or Outright where the odds or market data have changed after June 1st 12:01:30pm.
http://31.172.83.181:8080/free/markets/{"Cat":2,"TypeOr":[1,2],"SoftChangedAfter":"2016-06-01T12:01:30","OnlyActive":true,"ToID":10000}
Returns all active non-empty markets.
http://31.172.83.181:8080/free/markets/{"OnlyActive":true,"NoZombie":true,"ToID":100000}
- Cat: Category, see Categories for more information. 0 queries all Categories.
- TitleAND: List of strings which all must appear in the title of the market.
- RunnerAND: List of strings which all must be contained in at least one name of one runner of the market.
- TitleNOT: List of strings which none may appear in the title of the market.
- Comp: Competition name. null to get all competitions.
- TypeOr: Market Types, see Types for more information. Only the Market Types given will be returned. If set to null, all market types will be returned.
- PeriodOr: Market Period, see Periods for more information.
- SettleOr: Settlement Type, see Settlements for more information.
- NoZombie: If True, no empty markets will be returned (without any open order).
- Descr: The given string must appear in the market description.
- ChangedAfter: Return markets where the meta data was changed after the given date. Usually the Closing and Settlement Dates of a market is the only data that changes.
- SoftChangedAfter: Return all markets, where either the the meta data or the orderbook has changed since the given date.
- FromClosT: Return markets where the closing time is greater than the given one.
- FromID: Return markets with id greater than this.
- ToID: Return markets with id lower than this.
- ToID Has a default value of 300 if not set.
Competitions
Call: http://31.172.83.181:8080/free/comps/CATEGORYID Example for all soccer competitions:
http://31.172.83.181:8080/free/comps/1
Returns all competitions in the selected category. See Categories