### Get Markets Request Example (Python) Source: https://developers.matchbook.com/reference/get-markets This Python snippet demonstrates how to make a GET request to the Get Markets endpoint. It includes setting the URL with query parameters and necessary headers. Ensure you have the 'requests' library installed. ```python import requests ``` ```python url = "https://api.matchbook.com/edge/rest/events/event_id/markets?offset=0&per-page=20&states=open%2Csuspended&exchange-type=back-lay&odds-type=DECIMAL&include-prices=false&price-depth=3&price-mode=expanded&exclude-mirrored-prices=false" ``` ```python headers = { "accept": "application/json", "User-Agent": "api-doc-test-client" } ``` ```python response = requests.get(url, headers=headers) ``` ```python print(response.text) ``` -------------------------------- ### Get Runners Request Example (Python) Source: https://developers.matchbook.com/reference/get-runners This Python snippet demonstrates how to make a GET request to the Get Runners endpoint. It includes setting up the URL with query parameters and defining necessary headers. Ensure you have the 'requests' library installed. ```python import requests ``` ```python url = "https://api.matchbook.com/edge/rest/events/event_id/markets/market_id/runners?states=open%2Csuspended&include-withdrawn=true&include-prices=true&price-depth=3&price-mode=expanded&exchange-type=back-lay&odds-type=DECIMAL&exclude-mirrored-prices=false" ``` ```python headers = { "accept": "application/json", "User-Agent": "api-doc-test-client" } ``` ```python response = requests.get(url, headers=headers) ``` ```python print(response.text) ``` -------------------------------- ### Get Prices Request (Shell) Source: https://developers.matchbook.com/reference/get-prices Example of how to construct a GET request to retrieve prices. Ensure to replace placeholder IDs with actual values. ```Shell curl -X GET \ 'https://api.matchbook.com/edge/rest/events/event_id/markets/market_id/runners/runner_id/prices?exchange-type=back-lay&odds-type=DECIMAL&depth=3&price-mode=expanded&exclude-mirrored-prices=false' \ -H 'accept: application/json' \ -H 'User-Agent: api-doc-test-client' ``` -------------------------------- ### Get Runner Request Example Source: https://developers.matchbook.com/reference/get-runner This example demonstrates how to make a GET request to the Get Runner endpoint using Python's requests library. It includes setting the URL with query parameters and necessary headers. ```Python import requests ``` ```Python url = "https://api.matchbook.com/edge/rest/events/event_id/markets/market_id/runners/runner_id?include-prices=false&price-depth=3&price-mode=expanded&exchange-type=back-lay&odds-type=DECIMAL&exclude-mirrored-prices=false" ``` ```Python headers = { "accept": "application/json", "User-Agent": "api-doc-test-client" } ``` ```Python response = requests.get(url, headers=headers) ``` ```Python print(response.text) ``` -------------------------------- ### Get Prices Request (Node.js) Source: https://developers.matchbook.com/reference/get-prices Example of how to make a GET request to retrieve prices using Node.js. This snippet demonstrates setting up the URL and headers. ```JavaScript const https = require('https'); const options = { hostname: 'api.matchbook.com', port: 443, path: '/edge/rest/events/event_id/markets/market_id/runners/runner_id/prices?exchange-type=back-lay&odds-type=DECIMAL&depth=3&price-mode=expanded&exclude-mirrored-prices=false', method: 'GET', headers: { 'accept': 'application/json', 'User-Agent': 'api-doc-test-client' } }; const req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (e) => { console.error(e); }); req.end(); ``` -------------------------------- ### Python Request to Get Market Source: https://developers.matchbook.com/reference/get-market Use this Python snippet to make a GET request to the Matchbook API to retrieve market details. Ensure you have the 'requests' library installed. The example includes setting necessary headers and printing the response. ```Python import requests ``` ```Python url = "https://api.matchbook.com/edge/rest/events/event_id/markets/market_id?exchange-type=back-lay&odds-type=DECIMAL&include-prices=false&price-depth=3&price-mode=expanded&exclude-mirrored-prices=false" ``` ```Python headers = { "accept": "application/json", "User-Agent": "api-doc-test-client" } ``` ```Python response = requests.get(url, headers=headers) ``` ```Python print(response.text) ``` -------------------------------- ### Submit Offers Request Example Source: https://developers.matchbook.com/reference/submit-offers-v2 This is an example of a request body for submitting one or more offers. Ensure the 'offers' field is a valid JSON array. ```json { "odds-type": "DECIMAL", "exchange-type": "back-lay", "offers": [ { "runner-id": 401525949430009, "side": "back", "odds": 2.4, "stake": 5, "keep-in-play": true } ] } ``` -------------------------------- ### Python Login Example Source: https://developers.matchbook.com/reference/login This Python script demonstrates how to authenticate with the Matchbook API using the `requests` library. It sends a POST request with JSON credentials and prints the obtained session token. Ensure you have the `requests` library installed. ```python import requests import json url = "https://api.matchbook.com/bpapi/rest/security/session" payload ={ "username":"jblogss", "password":"verysecurepassword" } header = { 'content-type': 'application/json;charset=UTF-8', 'accept': '*/*' } def login(): r = requests.post(url, data=json.dumps(payload), headers=header) data = r.json() return data['session-token'] token = login() print(token) ``` -------------------------------- ### Get Event Details with Prices (Python) Source: https://developers.matchbook.com/reference/get-event Use this snippet to fetch detailed event information, including prices. Ensure you have the 'requests' library installed. The User-Agent header is required. ```Python import requests ``` ```Python url = "https://api.matchbook.com/edge/rest/events/event_id?exchange-type=back-lay&odds-type=DECIMAL&include-prices=false&price-depth=3&price-mode=expanded&include-event-participants=false&exclude-mirrored-prices=false" ``` ```Python headers = { "accept": "application/json", "User-Agent": "api-doc-test-client" } ``` ```Python response = requests.get(url, headers=headers) ``` ```Python print(response.text) ``` -------------------------------- ### Get Prices Request (Python) Source: https://developers.matchbook.com/reference/get-prices Example of how to retrieve prices using Python's requests library. This snippet includes setting the URL and headers for the API call. ```Python import requests url = "https://api.matchbook.com/edge/rest/events/event_id/markets/market_id/runners/runner_id/prices?exchange-type=back-lay&odds-type=DECIMAL&depth=3&price-mode=expanded&exclude-mirrored-prices=false" headers = { "accept": "application/json", "User-Agent": "api-doc-test-client" } response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Submit Offers Response Example (Unmatched) Source: https://developers.matchbook.com/reference/submit-offers-v2 This is an example of a successful response when offers are submitted but not yet matched. It includes details of the submitted offer and its status. ```json { "language": "en", "currency": "EUR", "exchange-type": "back-lay", "odds-type": "DECIMAL", "offers": [ { "id": 413177013410013, "event-id": 410343160570009, "event-name": "Man Utd vs St Etienne", "market-id": 410343161840009, "market-name": "Match Odds", "market-type": "one_x_two", "runner-id": 401525949430009, "runner-name": "Man Utd", "exchange-type": "back-lay", "side": "back", "odds": 2.4, "odds-type": "DECIMAL", "decimal-odds": 2.4, "stake": 5, "remaining": 5, "potential-profit": 7, "remaining-potential-profit": 7, "commission-type": "VOLUME", "originator-commission-rate": 0, "acceptor-commission-rate": 0, "commission-reserve": 0, "currency": "EUR", "created-at": "2017-02-16T19:49:32.771Z", "status": "open", "in-play": false } ] } ``` -------------------------------- ### Get Regions API Request (Python) Source: https://developers.matchbook.com/reference/get-regions Use this Python snippet to make a GET request to the 'Get Regions' endpoint. Ensure you have the 'requests' library installed. The User-Agent header is recommended for API calls. ```Python import requests ``` ```Python url = "https://api.matchbook.com/bpapi/rest/lookups/regions/country_id" ``` ```Python headers = { "accept": "application/json", "User-Agent": "api-doc-test-client" } ``` ```Python response = requests.get(url, headers=headers) ``` ```Python print(response.text) ``` -------------------------------- ### Heartbeat Response Example (Success) Source: https://developers.matchbook.com/reference/post-heartbeat Example of a successful response from the Post Heartbeat endpoint. It confirms the heartbeat activation and provides the actual timeout and timestamp. ```json { "action-performed" : "HEARTBEAT_ACTIVATED", "actual-timeout" : 20, "timeout-time" : "2018-06-27T13:57:17.354Z" } ``` -------------------------------- ### Get Events Source: https://developers.matchbook.com/reference/get-events Retrieves a list of all available events on Matchbook, ordered by their start time. ```APIDOC ## GET /events ### Description Get a list of events available on Matchbook ordered by start time. ### Method GET ### Endpoint /events ### Parameters #### Query Parameters - **sort_by** (string) - Optional - Field to sort events by. Defaults to 'start_time'. - **order** (string) - Optional - Order of sorting. 'asc' or 'desc'. Defaults to 'asc'. ### Response #### Success Response (200) - **events** (array) - A list of event objects. - **event_id** (integer) - Unique identifier for the event. - **name** (string) - The name of the event. - **start_time** (string) - The start time of the event in ISO 8601 format. - **end_time** (string) - The end time of the event in ISO 8601 format. - **market_count** (integer) - The number of markets associated with the event. #### Response Example { "events": [ { "event_id": 12345, "name": "Premier League Match", "start_time": "2023-10-27T15:00:00Z", "end_time": "2023-10-27T17:00:00Z", "market_count": 50 } ] } ``` -------------------------------- ### Heartbeat Response Example (Error) Source: https://developers.matchbook.com/reference/post-heartbeat Example of an error response (400 Bad Request) from the Post Heartbeat endpoint. The body is empty. ```json {} ``` -------------------------------- ### Heartbeat Request Example Source: https://developers.matchbook.com/reference/post-heartbeat Example of a request body for the Post Heartbeat endpoint. It includes the timeout value. ```json { "timeout": 20 } ``` -------------------------------- ### GET /offers Source: https://developers.matchbook.com/reference/get-offers-v2 Retrieves a list of current unsettled offers. You can filter offers by their status. ```APIDOC ## GET /offers ### Description Get the current unsettled offers. This can include offers in all statuses. ### Method GET ### Endpoint /offers ### Query Parameters - **status** (string) - Optional - Filters offers by their status. Possible values: open, cancelled, edited, matched, flushed. ### Response #### Success Response (200) - **offers** (array) - A list of offer objects. - **status** (string) - The status of the offer (e.g., open, cancelled, edited, matched, flushed). - **description** (string) - A description of the offer status. #### Response Example ```json { "offers": [ { "status": "open", "description": "The offer is available to be matched by other users." }, { "status": "matched", "description": "The offer has been fully matched by one or more other users." } ] } ``` ``` -------------------------------- ### Get Countries Source: https://developers.matchbook.com/reference/get-countries Retrieves a list of countries used for account registration. ```APIDOC ## GET /bpapi/rest/lookups/countries ### Description Get the list of countries used for account registration. ### Method GET ### Endpoint /bpapi/rest/lookups/countries ### Response #### Success Response (200) - **countries** (array) - An array of country objects. - **country-id** (integer) - The unique identifier for the country. - **name** (string) - The name of the country. - **country-code** (string) - The two-letter country code. #### Response Example ```json { "countries": [ { "country-id": 77, "name": "Afghanistan", "country-code": "AF" }, { "country-id": 78, "name": "Albania", "country-code": "AL" }, { "country-id": 76, "name": "Alderney", "country-code": "ALD" }, { "country-id": 79, "name": "Algeria", "country-code": "DZ" } ] } ``` ``` -------------------------------- ### Get Account Source: https://developers.matchbook.com/reference/get-account Retrieves the account information for the currently logged-in user. Authentication is required. ```APIDOC ## GET /account ### Description Get the account information for the user currently logged in. This API requires authentication and will return a 401 in case the session expired or no session token is provided. ### Method GET ### Endpoint /account ### Parameters ### Request Body ### Request Example ### Response #### Success Response (200) - **user_id** (string) - The unique identifier for the user. - **username** (string) - The username of the user. - **email** (string) - The email address of the user. #### Response Example { "user_id": "123e4567-e89b-12d3-a456-426614174000", "username": "johndoe", "email": "johndoe@example.com" } ``` -------------------------------- ### Get Current Offers Source: https://developers.matchbook.com/reference/get-current-offers-v2 Retrieves a list of current offers on markets that have not yet been settled. ```APIDOC ## GET /reports/offers/current ### Description Get a list of current offers i.e. offers on markets yet to be settled. ### Method GET ### Endpoint /reports/offers/current ### Parameters ### Request Example (No request body for this GET request) ### Response #### Success Response (200) (Response structure not provided in the source text) #### Response Example (No response example provided in the source text) ``` -------------------------------- ### Get Offer Edit Source: https://developers.matchbook.com/reference/get-offer-edit-v2 Retrieves details for a single, specific unsettled offer edit. ```APIDOC ## GET /api/v1/betting/offers/edit ### Description Retrieves details for a single, specific unsettled offer edit. ### Method GET ### Endpoint /api/v1/betting/offers/edit ### Query Parameters - **status** (string) - Optional - Describes the current status of the offer edit. Values: 'applied', 'delayed', 'failed'. - **failure-reason** (string) - Optional - In case of edit failure during the delay, the reason of such failure is contained in the field. Values: 'market_status', 'runner_status', 'offer_status', 'offer_odds_stake', 'delay_timeout', 'server_error'. - **delay** (number) - Optional - Delay that was/will be applied to the offer edit in seconds. ### Response #### Success Response (200) - **status** (string) - Describes the current status of the offer edit. Values: 'applied', 'delayed', 'failed'. - **failure-reason** (string) - In case of edit failure during the delay, the reason of such failure is contained in the field. Values: 'market_status', 'runner_status', 'offer_status', 'offer_odds_stake', 'delay_timeout', 'server_error'. - **delay** (number) - Delay that was/will be applied to the offer edit in seconds. #### Response Example { "status": "failed", "failure-reason": "market_status", "delay": 30 } ``` -------------------------------- ### Get Account Sports API Response Source: https://developers.matchbook.com/reference/account-sports This is an example of a successful HTTP 200 response from the Get Account Sports endpoint. It lists sports with their IDs and names. ```http HTTP/1.1 200 Cache-Control: private, no-cache Connection: close Content-Length: 120 Content-Type: application/json Date: Tue, 14 Mar 2023 15:37:56 GMT X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block [ { "id": 241798357140019, "name": "Greyhound Racing" }, { "id": 24735152712200, "name": "Horse Racing" }, { "id": 15, "name": "Soccer" } ] ``` -------------------------------- ### GET /edge/rest/events Source: https://developers.matchbook.com/reference/get-events Retrieves a list of events available on Matchbook, ordered by start time. Supports filtering and pagination. ```APIDOC ## GET /edge/rest/events ### Description Get a list of events available on Matchbook ordered by start time. API GROUP : EVENTS ### Method GET ### Endpoint /edge/rest/events ### Parameters #### Query Parameters - **offset** (string) - Optional - Used for paging. The offset of the first entry in the response. Default: "0" - **per-page** (string) - Optional - Used for paging. The number of entries to return in a single response. Default: "20" - **after** (integer) - Optional - A unix epoch timestamp. Only events starting after the timestamp will be returned. - **before** (integer) - Optional - A unix epoch timestamp. Only events starting before the timestamp will be returned. - **category-ids** (string) - Optional - A comma separated list of category ids. Only events on the provided categories are included in the response. - **ids** (string) - Optional - A comma separated list of event ids. Only events with id in the provided list are included in the response. - **sport-ids** (string) - Optional - A comma separated list of sport ids. Only events with sport in the provided list are included in the response. - **states** (string) - Optional - A comma separated list of event states. Only events with status in the provided list are included in the response. Allowed values: open, suspended, closed, graded. Default: "open,suspended,closed,graded" - **tag-url-names** (string) - Optional - A comma separated list of *url-name*s. Only events with tags having *url-name* in the provided list are included in the response. - **exchange-type** (string) - Optional - Prices are returned in accordance with the specified *exchange-type*. Allowed values: *back-lay*, *binary*. Default: "back-lay" - **odds-type** (string) - Optional - Prices are returned in accordance with the specified *odds-type*. Allowed values: *DECIMAL*, *US*, *HK*, *MALAY*, *INDO*, *%*. Default: "DECIMAL" - **include-prices** (boolean) - Optional - A boolean indicating whether to return the prices for the events. Default: false - **price-depth** (integer) - Optional - Value indicating, for each runner, the maximum number of prices that will be returned in the response for each side. Default: 3 - **price-mode** (string) - Optional - Description for price-mode is missing in the source. ### Response #### Success Response (200) - **Response fields are not detailed in the source.** #### Response Example { "example": "Response body example not provided in source." } ``` -------------------------------- ### Get Market Data Source: https://developers.matchbook.com/reference/get-current-offers-v2 Retrieves detailed information about markets, including events, start times, and selections with their respective odds and stakes. ```APIDOC ## GET /api/v2/list-market-book ### Description Retrieves market data for specified events, including details on selections, odds, stakes, and potential profits. ### Method GET ### Endpoint /api/v2/list-market-book ### Query Parameters - **event_ids** (string) - Required - Comma-separated list of event IDs to retrieve market data for. - **include_unsettled_markets** (boolean) - Optional - Whether to include markets that are not yet settled. - **include_market_details** (boolean) - Optional - Whether to include detailed market information. ### Response #### Success Response (200) - **total** (integer) - The total number of markets returned. - **language** (string) - The language code for the response. - **currency** (string) - The currency code for the odds and stakes. - **odds-type** (string) - The type of odds returned (e.g., DECIMAL). - **markets** (array) - An array of market objects. - **id** (integer) - The unique identifier for the market. - **event-id** (integer) - The ID of the event associated with the market. - **event-name** (string) - The name of the event. - **start-time** (string) - The start time of the event in ISO 8601 format. - **sport-id** (integer) - The ID of the sport. - **name** (string) - The name of the market (e.g., "Match Odds"). - **selections** (array) - An array of selection objects within the market. - **runner-id** (integer) - The unique identifier for the selection. - **runner-name** (string) - The name of the selection (e.g., a team or player). - **side** (string) - The side of the bet (e.g., "back"). - **odds** (number) - The current odds for the selection. - **stake** (number) - The total stake on this selection. - **liability** (number) - The total liability on this selection. - **potential-profit** (number) - The potential profit for this selection. - **offers** (array) - An array of available offers for the selection. - **id** (integer) - The ID of the offer. - **odds** (number) - The odds of the offer. - **stake** (number) - The stake of the offer. - **in-play** (boolean) - Indicates if the offer is for an in-play bet. #### Response Example ```json { "total": 1, "language": "en", "currency": "EUR", "odds-type": "DECIMAL", "markets": [ { "id": 919619528410042, "event-id": 919619528170041, "event-name": "Manchester United vs Juventus", "start-time": "2018-10-23T19:00:00.000Z", "sport-id": 15, "name": "Match Odds", "selections": [ { "runner-id": 919619528480041, "runner-name": "Manchester United", "side": "back", "odds": 4.5, "stake": 0.5, "liability": 0.5, "potential-profit": 1.75, "offers": [ { "id": 938219405150048, "odds": 4.5, "stake": 0.5, "in-play": false } ] } ] } ] } ``` ``` -------------------------------- ### POST /bpapi/rest/security/session Source: https://developers.matchbook.com/reference Logs into Matchbook and creates a new session. The response includes a session token that should be used for all subsequent requests. Sessions last approximately 6 hours. ```APIDOC ## POST /bpapi/rest/security/session ### Description Logs into Matchbook and creates a new session. The response includes a session token value. This value should be included with all subsequent requests as either a cookie named "session-token" or a header named "session-token". Matchbook sessions live for approximately 6 hours so only 1 login request every 6 hours is required. The same session should be used for all requests in that period. ### Method POST ### Endpoint https://api.matchbook.com/bpapi/rest/security/session ### Parameters #### Request Body - **username** (string) - required - Username for account - **password** (string) - required - Password for account ### Request Example ```json { "username": "jblogss", "password": "verysecurepassword" } ``` ### Response #### Success Response (200) - **session-token** (string) - The session token for subsequent requests. #### Response Example ```json { "session-token": "YOUR_SESSION_TOKEN" } ``` ``` -------------------------------- ### Edit Offers Response Example Source: https://developers.matchbook.com/reference/edit-offers-v2 This is a successful response after editing an offer. It includes details of the updated offer, such as new odds, stake, and status. ```json { "currency": "EUR", "exchange-type": "back-lay", "odds-type": "DECIMAL", "offers": [ { "id": 422497589540014, "event-id": 500000000000072, "event-name": "18:00 Windsor", "market-id": 500000000000091, "market-name": "WIN", "market-type": "outright_ded_fact", "runner-id": 500000000000092, "runner-name": "1 Call Of The Loon", "temp-id": "50", "exchange-type": "back-lay", "side": "back", "odds": 3, "odds-type": "DECIMAL", "decimal-odds": 3, "stake": 100, "remaining": 100, "potential-liability": 100, "remaining-potential-liability": 100, "commission-type": "VOLUME", "originator-commission-rate": 0.01, "acceptor-commission-rate": 0.01, "commission-reserve": 1, "currency": "EUR", "created-at": "2018-10-02T10:14:16.103Z", "status": "edited", "in-play": false, "offer-edit": { "id": 925184068850125, "offer-id": 925183846730025, "odds-type": "DECIMAL", "odds-before": 1.5, "decimal-odds-before": 1.5, "odds-after": 3, "decimal-odds-after": 3, "stake-before": 50, "stake-after": 100, "status": "applied", "delay": 6, "edit-time": "2018-10-02T10:14:38.315Z" } } ] } ``` -------------------------------- ### Offer Details Source: https://developers.matchbook.com/reference/edit-offers-v2 This section details the structure of an offer object, including its properties like ID, event details, market information, and betting odds. ```APIDOC ## Offer Object Structure ### Description Represents a betting offer on the Matchbook exchange, including details about the event, market, runner, and the specific bet placed. ### Properties - **id** (integer) - Unique identifier for the offer. - **event-id** (integer) - Identifier for the associated event. - **event-name** (string) - Name of the event. - **market-id** (integer) - Identifier for the market within the event. - **market-name** (string) - Name of the market (e.g., WIN). - **market-type** (string) - Type of the market (e.g., outright_ded_fact). - **runner-id** (integer) - Identifier for the runner (selection) within the market. - **runner-name** (string) - Name of the runner. - **temp-id** (string) - Temporary identifier for the offer. - **exchange-type** (string) - Type of exchange (e.g., back-lay). - **side** (string) - The side of the bet (e.g., back). - **odds** (number) - The odds for the bet. - **odds-type** (string) - The type of odds (e.g., DECIMAL). - **decimal-odds** (number) - The odds in decimal format. ``` -------------------------------- ### Get a Single Unsettled Offer (Python) Source: https://developers.matchbook.com/reference/get-offer-v2 Use this snippet to fetch a specific unsettled offer by its ID. Ensure the 'requests' library is installed. The 'include-edits' query parameter can be set to true to include edits applied to the offer. ```Shell import requests ``` ```Python url = "https://api.matchbook.com/edge/rest/v2/offers/offer_id?include-edits=false" ``` ```Python headers = { "accept": "application/json", "User-Agent": "api-doc-test-client" } ``` ```Python response = requests.get(url, headers=headers) ``` ```Python print(response.text) ``` -------------------------------- ### OK - matched Source: https://developers.matchbook.com/reference/submit-offers-v2 This snippet describes the response structure for a successful 'matched' status, including language and currency. ```APIDOC ## OK - matched ### Description This section details the response structure for a successful operation where the status is 'matched'. It includes language and currency information. ### Response #### Success Response (200) - **language** (string) - The language code for the response (e.g., "en"). - **currency** (string) - The currency code for the response (e.g., "EUR"). ### Response Example ```json { "language": "en", "currency": "EUR" } ``` ``` -------------------------------- ### Get Sports API Definition Source: https://developers.matchbook.com/reference/get-sports This is the OpenAPI definition for the Get Sports API endpoint. It outlines the available parameters for filtering and sorting sports data. ```json { "openapi": "3.1.0", "info": { "title": "API Settings", "version": "1.0" }, "servers": [ { "url": "https://api.matchbook.com" } ], "security": [ {} ], "paths": { "/edge/rest/lookups/sports": { "get": { "summary": "Get Sports", "description": "Get the list of sports supported by Matchbook.\n\nAPI GROUP : NAVIGATION", "operationId": "get-sports", "parameters": [ { "name": "offset", "in": "query", "description": "Used for paging. The offset of the first entry in the response.", "schema": { "type": "integer", "format": "int64", "default": 0 } }, { "name": "per-page", "in": "query", "description": "Used for paging. The number of entries to return in a single response.", "schema": { "type": "integer", "format": "int64", "default": 20 } }, { "name": "order", "in": "query", "description": "Used for sorting results by *name* or *id* in ascending or descending order. Allowed values: *name asc*, *name desc*, *id asc*, *id desc*.", "schema": { "type": "string", "default": "name asc" } }, { "name": "status", "in": "query", "description": "A comma separated list of statuses. Only sports with status in the provided list are included in the response.", "schema": { "type": "string", "default": "active" } } ], "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": "{\n \"total\": 13,\n \"per-page\": 20,\n \"offset\": 0,\n \"sports\": [\n {\n \"name\": \"Basketball\",\n \"type\": \"SPORT\",\n \"id\": 4\n },\n {\n \"name\": \"Boxing\",\n \"type\": \"SPORT\",\n \"id\": 14\n },\n {\n \"name\": \"Cricket\",\n \"type\": \"SPORT\",\n \"id\": 110\n },\n {\n \"name\": \"Darts\",\n \"type\": \"SPORT\",\n \"id\": 116\n },\n {\n \"name\": \"Golf\",\n \"type\": \"SPORT\",\n \"id\": 8\n },\n ...\n ]\n}" } } } } } }, "deprecated": false, "security": [] } } }, "x-readme": { "headers": [ { "key": "User-Agent", "value": "api-doc-test-client" } ], "explorer-enabled": false, "proxy-enabled": true }, "x-readme-fauxas": true, "_id": "58b53d1c1065f9c438aa22fa:589b29056d051e0f00f42ef6" } ``` -------------------------------- ### Submit Offers Source: https://developers.matchbook.com/reference/submit-offers-v2 Submit one or more offers, i.e., your intention or willingness to have bets with other users. Note: Binary mode is no longer supported for new offer submissions. ```APIDOC ## POST /offers ### Description Submit one or more offers, representing your intention or willingness to have bets with other users. ### Method POST ### Endpoint /offers ### Parameters #### Request Body - **runner-id** (Long) - Required - Runner unique identifier. - **side** (String) - Required - Either back, lay, win or lose. - **odds** (Float) - Required - Offer odds following the format specified with odds-type. - **stake** (Float) - Required - Offer stake. - **keep-in-play** (Boolean) - Optional - A boolean indicating whether the unmatched part of the offer will remain active when the event goes in play. Defaults to false. ### Request Example ```json { "runner-id": 12345, "side": "back", "odds": 2.5, "stake": 10.0, "keep-in-play": true } ``` ### Response #### Success Response (200) - **status** (String) - The status of the submitted offer (e.g., open, matched, cancelled). - **id** (String) - The unique identifier for the submitted offer. #### Response Example ```json { "status": "open", "id": "offer123" } ``` ### Offer Statuses - **open**: The offer is available to be matched by other users. - **cancelled**: The offer has been cancelled by the user. - **edited**: The offer has been edited by the user but is still available to be matched by other users with the new values. - **matched**: The offer has been fully matched by one or more other users. - **flushed**: The offer has been flushed by the system and is no longer available to be matched by other users. - **failed**: Offer submission failed. The accompanying error message will give the failure reason. - **delayed**: Offer submission was delayed due to in-play market. The offer will enter the market after the delay or it will fail. During the delay the offer is not available for matching. ``` -------------------------------- ### Matchbook API Reference Source: https://developers.matchbook.com/reference/get-current-bets-v2 This section details the structure and properties of the Matchbook API, including data types, examples, and default values for various fields. ```APIDOC ## Matchbook API Reference ### Description This section details the structure and properties of the Matchbook API, including data types, examples, and default values for various fields. ### Endpoint /websites/developers_matchbook_reference ### Response #### Success Response (200) - **matched-time** (string) - Example: "2018-10-17T12:18:37.393Z" - **adjusted** (boolean) - Example: false, Default: true - **potential-profit** (number) - Example: 12.6, Default: 0 - **liability** (integer) - Example: 5, Default: 0 #### Response Example ```json { "matched-time": "2018-10-17T12:18:37.393Z", "adjusted": false, "potential-profit": 12.6, "liability": 5 } ``` #### Error Response (400) - **Result** (object) - Example: {} #### Error Response Example ```json {} ``` ```