Bets API Specification v1.0


Overview

Bets API is a RESTful service for data on all sports. It is a PAID service with low price (started with $10 per month).

Please note that in order to access Bets API you must contact us.

Authentication

You will get a token from our support. you can either pass it in header X-API-TOKEN or pass as token= in GET query.

API Endpoints

API endpoint started with https://api.betsapi.com/v1, http is also supported but https is recommended.

Events

We have 3 endpoints for all events, including:

  • /events/inplay
  • /events/upcoming
  • /events/ended
Param NameRequired?Description
sport_idYesReference
league_idNouseful when you want only one league
dayNoformat YYYYMMDD, eg: 20161201
pageNoPager reference

Sample request URL as: https://api.betsapi.com/v1/events/inplay?token=YOUR_TOKEN&sport_id=1

{
    "success": 1,
    "pager": {
        "page": 1,
        "per_page": 50,
        "total": 12
    },
    "results": [
        {
            "id": "68384",
            "time": "1478076778",
            "time_status": "1",
            "league": {
                "id": "2103",
                "name": "FIBA Europe Cup"
            },
            "home": {
                "id": "7704",
                "name": "Enisey Krasnoyarsk"
            },
            "away": {
                "id": "56003",
                "name": "Sigal Prishtina"
            },
            "timer": {
                "tm": "2",
                "ts": "31",
                "q": "3"
            },
            "scores": {
                "1": {
                    "home": "22",
                    "away": "32"
                },
                "2": {
                    "home": "18",
                    "away": "18"
                },
                "3": {
                    "home": "40",
                    "away": "50"
                },
                "4": {
                    "home": "19",
                    "away": "13"
                },
                "5": {
                    "home": "",
                    "away": ""
                },
                "6": {
                    "home": "",
                    "away": ""
                },
                "7": {
                    "home": "59",
                    "away": "63"
                }
            }
        },
        {
        ...
        }
    ]
}

Events Search

/events/search

Param NameRequired?Description
sport_idYesReference
homeYeshome team name
awayYesaway team name
timeYesUTC time epoch

Sample request URL as: https://api.betsapi.com/v1/events/search?token=YOUR_TOKEN&sport_id=1&home=Man%20City&away=Barcelona&time=1478029500

{
    "success": 1,
    "results": [
        {
            "id": "54750",
            "time": "1478029500",
            "time_status": "3",
            "league": {
                "id": "1040",
                "name": "UEFA Champions League"
            },
            "home": {
                "id": "708",
                "name": "Man City"
            },
            "away": {
                "id": "1211",
                "name": "Barcelona"
            },
            "scores": {
                "2": {
                    "home": "3",
                    "away": "1"
                }
            }
        }
    ]
}

Event View

/event/view

Param NameRequired?Description
event_idYesEvent ID you get from events/*

Note: you can send multiple event_ids in one request with event_id=1,2,3,4 up to max 10 ids.

Sample request URL as: https://api.betsapi.com/v1/event/view?token=YOUR_TOKEN&event_id=92149

{
    "success": 1,
    "results": [
        {
            "id": "92149",
            "time": "1480289400",
            "time_status": "1",
            "league": {
                "id": "881",
                "name": "Bolivia Apertura"
            },
            "home": {
                "id": "44204",
                "name": "Oriente Petrolero"
            },
            "away": {
                "id": "61076",
                "name": "Jorge Wilsterman"
            },
            "timer": {
                "tm": 45,
                "ts": 0
            },
            "scores": {
                "2": {
                    "home": "0",
                    "away": "1"
                }
            },
            "stats": {
                "corners": [
                    "4",
                    "1"
                ],
                "yellowcards": [
                    "1",
                    "0"
                ],
                "redcards": [
                    "0",
                    "0"
                ],
                "penalties": [
                    "0",
                    "0"
                ],
                "substitutions": [
                    "0",
                    "0"
                ],
                "attacks": [
                    "77",
                    "56"
                ],
                "dangerous_attacks": [
                    "48",
                    "39"
                ],
                "on_target": [
                    "0",
                    "2"
                ],
                "off_target": [
                    "3",
                    "0"
                ],
                "possession_rt": [
                    "57",
                    "43"
                ]
            }
        }
    ]
}

Event Odds

/event/odds

Param NameRequired?Description
event_idYesEvent ID you get from events/*
sourceNoPossible value: bet365, 10bet, ladbrokes, williamhill, betclic, pinnaclesports, planetwin365, ysb88. defaults to bet365.
since_timeNoInteger. add_time will be >= $since_time in results. Faster to get only updates.

Sample request URL as: https://api.betsapi.com/v1/event/odds?token=YOUR_TOKEN&event_id=77770

{
    "success": 1,
    "results": {
        "winner": [
            {
                "id": "1730226",
                "host_od": "1.167",
                "guest_od": "4.500",
                "ss": "2-6,7-6,4-3",
                "add_time": "1478692179"
            },
            {
                "id": "1730179",
                "host_od": "1.250",
                "guest_od": "3.750",
                "ss": "2-6,7-6,4-3",
                "add_time": "1478692121"
            },
            ...
        ]
    }
}

League

/league

Param NameRequired?Description
sport_idYesReference
pageNoPager reference

Sample request URL as: https://api.betsapi.com/v1/league?sport_id=1&token=YOUR_TOKEN&pretty=1

{
    "success": 1,
    "pager": {
        "page": 1,
        "per_page": 50,
        "total": 785
    },
    "results": [
        {
            "id": "1",
            "name": "Mexico Liga de Ascenso Apertura"
        },
        {
            "id": "2",
            "name": "Australia New South Wales League 2"
        },
        {
            "id": "3",
            "name": "Australia Queensland Premier League Women"
        },
        {
            "id": "4",
            "name": "Australia New South Wales U20 League"
        },
        ...
    }
}

Bet365 InPlay Data

/bet365/inplay

Param NameRequired?Description
rawNoraw Bet365 body without parsing

Note it requires bet365 permission.

Sample request URL as: https://api.betsapi.com/v1/bet365/inplay?token=YOUR_TOKEN&pretty=1

{
    "success": 1,
    "results": [
        [
            {
                "type": "CG",
                "AQ": "0",
                "CB": "0",
                "CM": "1",
                "CP": "0",
                "CW": "1",
                "DM": "0",
                "EE": "",
                "IF": "1",
                "IT": "CONFIG_1_3",
                "MB": "0",
                "MC": "1",
                "MR": "1",
                "MT": "0",
                "OP": "0",
                "PB": "1",
                "RE": "",
                "SB": "1",
                "WB": "0",
                "WC": "1",
                "WR": "1",
                "WT": "1"
            },
            {
                "type": "\b\u0014OVInPlay_1_3\u0001F"
            },
            {
                "type": "CL",
                "FF": "",
                "ID": "1",
                "IT": "OV_1_1_3",
                "MR": "1777#Fulltime Result$1$X$2^10124#Match Goals$Over$Under^10147#Asian Handicap In-Play$1$2^10148#Goal Line In-Play$Over$Under",
                "NA": "Soccer",
                "OR": "0",
                "PC": "3"
            },
            {
                "type": "CT",
                "FF": "",
                "ID": "1",
                "IT": "OVHong-Kong-ReDivC1_1_3",
                "NA": "Hong Kong Reserve Division",
                "OR": "0"
            },
            {
                "type": "EV",
                "AU": "0",
                "C1": "1",
                "C2": "31521337",
                "C3": "60536246",
                "CB": "",
                "CC": "Hong Kong ReDiv",
                "CP": "",
                "CT": "Hong Kong Reserve Division",
                "DC": "1",
                "ES": "",
                "ET": "0",
                "FF": "",
                "FI": "60504279",
                "FS": "1",
                "ID": "15315213372C1_1_3",
                "IT": "OV15315213372C1_1_3",
                "LM": "20",
                "MO": "0",
                "MP": "",
                "MS": "0",
                "NA": "HK Rangers FC Reserves v Southern District Reserves",
                "OR": "0",
                "PE": "",
                "SD": "0",
                "SE": "0",
                "SS": "4-0",
                "SV": "1",
                "T1": "5",
                "T2": "2",
                "T3": "3",
                "TD": "0",
                "TM": "45",
                "TS": "0",
                "TT": "1",
                "TU": "20161207113417",
                "UC": "",
                "VI": "0",
                "VS": ""
            },
            {
                "type": "EV",
                "AU": "0",
                "C1": "1",
                "C2": "31521342",
                "C3": "60536251",
                "CB": "",
                "CC": "Hong Kong ReDiv",
                "CP": "",
                "CT": "Hong Kong Reserve Division",
                "DC": "1",
                "ES": "",
                "ET": "0",
                "FF": "",
                "FI": "60504286",
                "FS": "1",
                "ID": "15315213422C1_1_3",
                "IT": "OV15315213422C1_1_3",
                "LM": "24",
                "MO": "0",
                "MP": "",
                "MS": "0",
                "NA": "Wofoo Tai Po Reserves v BC Glory Sky Reserves",
                "OR": "1",
                "PE": "",
                "SD": "0",
                "SE": "0",
                "SS": "0-1",
                "SV": "1",
                "T1": "5",
                "T2": "2",
                "T3": "3",
                "TD": "0",
                "TM": "45",
                "TS": "1",
                "TT": "1",
                "TU": "20161207113309",
                "UC": "",
                "VI": "0",
                "VS": ""
            },
            {
                "type": "MA",
                "CN": "3",
                "FF": "",
                "FI": "60536251",
                "ID": "1777",
                "IT": "OV15315213422C1-1777_1_3",
                "NA": "Fulltime Result",
                "OR": "0",
                "PC": "OV_1_1_3",
                "SU": "0",
                "SY": "0",
                "TO": "1~GD"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536251",
                "HA": "",
                "HD": "",
                "ID": "1172535684",
                "IT": "OV1172535684_1_3",
                "NA": "Wofoo Tai Po Reserves",
                "OD": "16\/1",
                "OR": "0",
                "SU": "0"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536251",
                "HA": "",
                "HD": "",
                "ID": "1172535685",
                "IT": "OV1172535685_1_3",
                "NA": "Draw",
                "OD": "6\/1",
                "OR": "1",
                "SU": "0"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536251",
                "HA": "",
                "HD": "",
                "ID": "1172535686",
                "IT": "OV1172535686_1_3",
                "NA": "BC Glory Sky Reserves",
                "OD": "1\/9",
                "OR": "2",
                "SU": "0"
            },
            {
                "type": "CT",
                "FF": "",
                "ID": "1",
                "IT": "OVGOAPROC1_1_3",
                "NA": "India Goa Pro League",
                "OR": "1"
            },
            {
                "type": "EV",
                "AU": "0",
                "C1": "1",
                "C2": "31521331",
                "C3": "60536240",
                "CB": "",
                "CC": "GOAPRO",
                "CP": "",
                "CT": "India Goa Pro League",
                "DC": "1",
                "ES": "",
                "ET": "0",
                "FF": "",
                "FI": "60496232",
                "FS": "1",
                "ID": "15315213312C1_1_3",
                "IT": "OV15315213312C1_1_3",
                "LM": "19",
                "MO": "0",
                "MP": "",
                "MS": "0",
                "NA": "Salgaocar SC v FC Bardez",
                "OR": "0",
                "PE": "",
                "SD": "0",
                "SE": "0",
                "SS": "2-0",
                "SV": "1",
                "T1": "5",
                "T2": "2",
                "T3": "3",
                "TD": "0",
                "TM": "45",
                "TS": "0",
                "TT": "1",
                "TU": "20161207111349",
                "UC": "",
                "VI": "0",
                "VS": ""
            },
            {
                "type": "MA",
                "CN": "3",
                "FF": "",
                "FI": "60536240",
                "ID": "1777",
                "IT": "OV15315213312C1-1777_1_3",
                "NA": "Fulltime Result",
                "OR": "0",
                "PC": "OV_1_1_3",
                "SU": "0",
                "SY": "0",
                "TO": "1~GD"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536240",
                "HA": "",
                "HD": "",
                "ID": "1172534084",
                "IT": "OV1172534084_1_3",
                "NA": "Salgaocar SC",
                "OD": "1\/80",
                "OR": "0",
                "SU": "0"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536240",
                "HA": "",
                "HD": "",
                "ID": "1172534085",
                "IT": "OV1172534085_1_3",
                "NA": "Draw",
                "OD": "22\/1",
                "OR": "1",
                "SU": "0"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536240",
                "HA": "",
                "HD": "",
                "ID": "1172534086",
                "IT": "OV1172534086_1_3",
                "NA": "FC Bardez",
                "OD": "40\/1",
                "OR": "2",
                "SU": "0"
            },
            {
                "type": "CT",
                "FF": "",
                "ID": "1",
                "IT": "OVIran-Div-1C1_1_3",
                "NA": "Iran Div 1",
                "OR": "2"
            },
            {
                "type": "EV",
                "AU": "0",
                "C1": "1",
                "C2": "31521364",
                "C3": "60536273",
                "CB": "",
                "CC": "Iran Div 1",
                "CP": "",
                "CT": "Iran Div 1",
                "DC": "1",
                "ES": "",
                "ET": "0",
                "FF": "",
                "FI": "60499432",
                "FS": "1",
                "ID": "15315213642C1_1_3",
                "IT": "OV15315213642C1_1_3",
                "LM": "37",
                "MO": "0",
                "MP": "",
                "MS": "0",
                "NA": "Aluminium Arak v Baderan Tehran",
                "OR": "0",
                "PE": "",
                "SD": "0",
                "SE": "0",
                "SS": "0-0",
                "SV": "1",
                "T1": "5",
                "T2": "2",
                "T3": "3",
                "TD": "0",
                "TM": "45",
                "TS": "1",
                "TT": "1",
                "TU": "20161207113314",
                "UC": "",
                "VI": "0",
                "VS": ""
            },
            {
                "type": "MA",
                "CN": "3",
                "FF": "",
                "FI": "60536273",
                "ID": "1777",
                "IT": "OV15315213642C1-1777_1_3",
                "NA": "Fulltime Result",
                "OR": "0",
                "PC": "OV_1_1_3",
                "SU": "0",
                "SY": "0",
                "TO": "1~GD"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536273",
                "HA": "",
                "HD": "",
                "ID": "1172538670",
                "IT": "OV1172538670_1_3",
                "NA": "Aluminium Arak",
                "OD": "7\/4",
                "OR": "0",
                "SU": "0"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536273",
                "HA": "",
                "HD": "",
                "ID": "1172538671",
                "IT": "OV1172538671_1_3",
                "NA": "Draw",
                "OD": "20\/21",
                "OR": "1",
                "SU": "0"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536273",
                "HA": "",
                "HD": "",
                "ID": "1172538672",
                "IT": "OV1172538672_1_3",
                "NA": "Baderan Tehran",
                "OD": "7\/2",
                "OR": "2",
                "SU": "0"
            },
            ...
        ],
    }
}

Bet365 Event Data

/bet365/event

Param NameRequired?Description
FIYesFI from Bet365 InPlay Data
rawNoraw Bet365 body without parsing

Note it requires bet365 permission.

Sample request URL as: https://api.betsapi.com/v1/bet365/event?token=YOUR_TOKEN&pretty=1&FI=60504279

{
    "success": 1,
    "results": [
        [
            {
                "type": "EV",
                "AM": "0_9",
                "AS": "",
                "AU": "0",
                "C1": "1",
                "C2": "31521337",
                "C3": "60536246",
                "CB": "",
                "CC": "Hong Kong ReDiv",
                "CK": "Hong Kong ReDiv",
                "CL": "1",
                "CM": " ",
                "CT": "Hong Kong Reserve Division",
                "CU": "",
                "DC": "1",
                "DO": "1",
                "DS": "",
                "ED": "",
                "EI": "1-1-5-31521337-2-737",
                "EL": "0",
                "ES": "",
                "ET": "0",
                "EX": "",
                "FF": "",
                "FI": "60504279",
                "FS": "1",
                "HO": "1",
                "HP": "1",
                "ID": "15315213372C1_1_3",
                "IT": "15315213372C1_1_3",
                "LM": "20",
                "MC": "",
                "MD": "1",
                "ML": "90",
                "MM": "",
                "MO": "0",
                "MP": "",
                "MS": "0",
                "NA": "HK Rangers FC Reserves v Southern District Reserves",
                "NT": "Neutral Venue",
                "RO": "1",
                "SB": "0",
                "SD": "0",
                "SE": "0",
                "SS": "4-0",
                "SV": "1",
                "SY": "",
                "T1": "5",
                "T2": "2",
                "T3": "3",
                "TD": "0",
                "TM": "45",
                "TO": "1~GD",
                "TS": "0",
                "TT": "1",
                "TU": "20161207113417",
                "UC": "",
                "VI": "0",
                "VS": ""
            },
            {
                "type": "TG",
                "AD": "",
                "CT": "Soccer",
                "DS": "1",
                "ED": "",
                "ID": "60504279",
                "IT": "60504279C1G_1_3",
                "OR": "0"
            },
            {
                "type": "TE",
                "EX": "",
                "ID": "1",
                "IT": "60504279C1T1_1_3",
                "KC": "#80FFFF,#80FFFF,#D446BA,#00C1BA,#C40010,#0046A8,#80FFFF",
                "KI": "3",
                "NA": "HK Rangers FC Reserves",
                "OR": "0",
                "PI": "0",
                "PO": "0",
                "SC": "4",
                "TC": "#80FFFF"
            },
            {
                "type": "TE",
                "EX": "",
                "ID": "2",
                "IT": "60504279C1T2_1_3",
                "KC": "#FF8040,#FF8040,#FF8040,#00C1BA,#C40010,#0046A8,#FF8040",
                "KI": "1",
                "NA": "Southern District Reserves",
                "OR": "1",
                "PI": "0",
                "PO": "0",
                "SC": "0",
                "TC": "#EF8450"
            },
            {
                "type": "ES",
                "AD": "",
                "ID": "",
                "IT": "60504279C1ES_1_3",
                "NA": "",
                "OR": "0",
                "PE": "",
                "SY": ""
            },
            {
                "type": "SC",
                "ID": "0",
                "IT": "60504279C1ES0_1_3",
                "NA": "",
                "OR": "0",
                "SY": "13",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "HK Rangers FC Reserves",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES0-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "Southern District Reserves",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES0-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "1",
                "IT": "60504279C1ES1_1_3",
                "NA": "IGoal",
                "OR": "1",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "4",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES1-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES1-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "2",
                "IT": "60504279C1ES2_1_3",
                "NA": "ICorner",
                "OR": "2",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "5",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES2-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES2-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "3",
                "IT": "60504279C1ES3_1_3",
                "NA": "IYellowCard",
                "OR": "3",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES3-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES3-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "4",
                "IT": "60504279C1ES4_1_3",
                "NA": "IRedCard",
                "OR": "4",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES4-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES4-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "5",
                "IT": "60504279C1ES5_1_3",
                "NA": "IThrowIn",
                "OR": "5",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "-",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES5-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "-",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES5-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "6",
                "IT": "60504279C1ES6_1_3",
                "NA": "IFreeKick",
                "OR": "6",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "-",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES6-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "-",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES6-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "7",
                "IT": "60504279C1ES7_1_3",
                "NA": "IGoalKick",
                "OR": "7",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "-",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES7-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "-",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES7-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "8",
                "IT": "60504279C1ES8_1_3",
                "NA": "IPenalty",
                "OR": "8",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES8-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES8-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "SC",
                "ID": "9",
                "IT": "60504279C1ES9_1_3",
                "NA": "ISubstitution",
                "OR": "9",
                "SY": "14",
                "VL": "1"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "0",
                "IT": "60504279C1ES9-0_1_3",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "SL",
                "D1": "0",
                "D2": "",
                "ID": "1",
                "IT": "60504279C1ES9-1_1_3",
                "OR": "1",
                "SY": "0"
            },
            {
                "type": "MA",
                "CN": "1",
                "DO": "1",
                "FF": "",
                "FI": "60536246",
                "IB": "0",
                "ID": "1778",
                "IM": "1",
                "IR": "",
                "IT": "60504279C1-1778_1_3",
                "MM": "",
                "NA": "5th Goal",
                "OR": "0",
                "OT": "0",
                "PI": "",
                "PT": "",
                "SU": "1",
                "TO": "1~GD",
                "UC": ""
            },
            {
                "type": "CO",
                "CN": "3",
                "ID": "1",
                "IT": "60504279C1-1778-1_1_3",
                "NA": "",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "PA",
                "BS": "HK Rangers FC Reserves to score 5th goal",
                "FI": "60536246",
                "HA": "",
                "HD": "",
                "ID": "1173033267",
                "IT": "P1173033267_1_3",
                "LA": "",
                "NA": "HK Rangers FC Reserves",
                "OD": "3\/10",
                "OR": "0",
                "SU": "1"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536246",
                "HA": "",
                "HD": "",
                "ID": "1173033270",
                "IT": "P1173033270_1_3",
                "LA": "",
                "NA": "No 5th Goal",
                "OD": "15\/2",
                "OR": "1",
                "SU": "1"
            },
            {
                "type": "PA",
                "BS": "Southern District Reserves to score 5th goal",
                "FI": "60536246",
                "HA": "",
                "HD": "",
                "ID": "1173033273",
                "IT": "P1173033273_1_3",
                "LA": "",
                "NA": "Southern District Reserves",
                "OD": "3\/1",
                "OR": "2",
                "SU": "1"
            },
            {
                "type": "MA",
                "CN": "1",
                "DO": "1",
                "FF": "",
                "FI": "60536246",
                "IB": "0",
                "ID": "10124",
                "IM": "1",
                "IR": "Current Goals : 4",
                "IT": "60504279C1-10124_1_3",
                "MM": "",
                "NA": "Match Goals",
                "OR": "1",
                "OT": "0",
                "PI": "",
                "PT": "",
                "SU": "1",
                "TO": "1~GD",
                "UC": ""
            },
            {
                "type": "CO",
                "CN": "2",
                "ID": "1",
                "IT": "60504279C1-10124-1_1_3",
                "NA": "",
                "OR": "0",
                "SY": "0"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536246",
                "HA": "6.5",
                "HD": " 6.5",
                "ID": "1172534718",
                "IT": "P1172534718_1_3",
                "LA": " 6.5",
                "NA": "Over ",
                "OD": "8\/11",
                "OR": "0",
                "SU": "1"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536246",
                "HA": "6.5",
                "HD": " 6.5",
                "ID": "1172534720",
                "IT": "P1172534720_1_3",
                "LA": " 6.5",
                "NA": "Under ",
                "OD": "1\/1",
                "OR": "1",
                "SU": "1"
            },
            ...
            {
                "type": "MA",
                "CN": "1",
                "DO": "0",
                "FF": "",
                "FI": "60536246",
                "IB": "1",
                "ID": "10147",
                "IM": "1",
                "IR": "",
                "IT": "60504279C1-10147_1_3",
                "MM": "",
                "NA": "Asian Handicap (4-0)",
                "OR": "5",
                "OT": "0",
                "PI": "",
                "PT": "",
                "SU": "1",
                "TO": "1~GD",
                "UC": ""
            },
            {
                "type": "CO",
                "CN": "2",
                "ID": "1",
                "IT": "60504279C1-10147-1_1_3",
                "NA": "",
                "OR": "0",
                "SY": "11"
            },
            {
                "type": "PA",
                "BS": "(4-0) HK Rangers FC Reserves",
                "FI": "60536246",
                "HA": "-1.5",
                "ID": "1173034008",
                "IT": "P1173034008_1_3",
                "LA": " -1.5",
                "NA": "HK Rangers FC Reserves  -1.5",
                "OD": "1\/1",
                "OR": "0",
                "SU": "1"
            },
            {
                "type": "PA",
                "BS": "(4-0) Southern District Reserves",
                "FI": "60536246",
                "HA": "+1.5",
                "ID": "1173034009",
                "IT": "P1173034009_1_3",
                "LA": " +1.5",
                "NA": "Southern District Reserves  +1.5",
                "OD": "4\/5",
                "OR": "1",
                "SU": "1"
            },
            ...
            {
                "type": "MA",
                "CN": "1",
                "DO": "0",
                "FF": "1~JKGg",
                "FI": "60536246",
                "IB": "0",
                "ID": "50185",
                "IM": "1",
                "IR": "Current Corners : 5",
                "IT": "60504279C1-50185_1_3",
                "MM": "",
                "NA": "Asian Corners",
                "OR": "8",
                "OT": "0",
                "PI": "",
                "PT": "",
                "SU": "1",
                "TO": "1~GD",
                "UC": ""
            },
            {
                "type": "CO",
                "CN": "2",
                "ID": "1",
                "IT": "60504279C1-50185-1_1_3",
                "NA": "",
                "OR": "0",
                "SY": "11"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536246",
                "HA": "8",
                "HD": " 8",
                "ID": "1172534776",
                "IT": "P1172534776_1_3",
                "LA": " 8",
                "NA": "Over",
                "OD": "9\/10",
                "OR": "0",
                "SU": "1"
            },
            {
                "type": "PA",
                "BS": "",
                "FI": "60536246",
                "HA": "8",
                "HD": " 8",
                "ID": "1172534777",
                "IT": "P1172534777_1_3",
                "LA": " 8",
                "NA": "Under",
                "OD": "9\/10",
                "OR": "1",
                "SU": "1"
            },
            ...
        ]
    ],
    "stats": {
        "event_id": "104216",
        "update_at": "1481110974"
    }
}

Bet365 PreMatch Odds Data

/bet365/start_sp

Param NameRequired?Description
event_idYesEvent ID you get from events/*
rawNoraw Bet365 HTML without parsing

Note it requires bet365 permission.

Sample request URL as: https://api.betsapi.com/v1/bet365/start_sp?token=YOUR_TOKEN&pretty=1&event_id=96729

{
    "success": 1,
    "results": [
        {
            "FI": "61049413",
            "event_id": "121215",
            "asian_lines": {
                "updated_at": "1483879373",
                "sp": {
                    "asian_handicap": [
                        {
                            "opp": "0.0",
                            "odds": "1.850",
                            "header": "Home"
                        },
                        {
                            "opp": "0.0",
                            "odds": "1.950",
                            "header": "Away"
                        }
                    ],
                    "goal_line": [
                        {
                            "goals": "3.0",
                            "odds": "2.100",
                            "header": "Over"
                        },
                        {
                            "goals": "3.0",
                            "odds": "1.700",
                            "header": "Under"
                        }
                    ],
                    "alternative_asian_handicap": [
                    ...
                }
            },
            "goals": {
                "updated_at": "1483879408",
                "sp": {
                    "alternative_total_goals": [
                    ...
                }
            },
            "half": {
                "updated_at": "1483879428",
                "sp": {
                    "half_time_result": [
                    ...
                }
            },
            "main": {
                "updated_at": "1483879360",
                "sp": {
                    "full_time_result": [
                    ...
                }
            },
            "corners": {
                ...
            },
            "player": {
                ...
            }
        }
    ]
}

Response

All responses are in JSON and has a success key to indicate it is successful or not.

You'll get results if everything moves well, and an error will be thrown if failed.

Reference

sport_id

sport_idName
1Soccer
18Basketball
78Handball
13Tennis
91Volleyball
16Baseball
17Ice Hockey
12American Football
14Snooker
3Cricket

error

errorDescription
INTERNAL_SERVER_ERROR500 Internal Server Error, contact Support if it happens
NOT_FOUND404 Not Found
METHOD_NOT_ALLOWEDMethod is not allowed, only GET is supported.
UNDER_MAINTENANCEAPI is under maintenance, we'll annouce it
AUTHORIZE_FAILEDToken is not provided or incorrect.
TOKEN_EXPIREDToken is expired.
PERMISSION_DENIEDYou're not allowed, contact Support if it is wrong.
PARAM_REQUIREDRequired param is missing, check error_detail for details
PARAM_INVALIDparam is invalid, check error_detail for details

pager

Whenever you see pager in the API response, it means you can go next page by passing page=2 etc. there are 3 elements inside which means:

ElementDescription
pageCurrent page
per_pagehow many results per page, default to 50 as always
totalhow many results in total. use it to indicate that it has next page or not.

time_status

ValueDescription
0Not Started
1InPlay
2TO BE FIXED
3Ended
4Postponed
5Cancelled

Pricing

SportPrice
Soccer$20 per month
Basketball$20 per month
Tennis$20 per month
Others$10 for each per month

We're also providing RAW bet365 data, contact us for more details.

Payment

We support both PayPal and Skrill:

  • PayPal: bsportsfan.com at gmail.com
  • Skrill: bsportsfan.com at gmail.com

FAQ

How can I get all historical data?

First try with League API, and go through pager to get all data.

Afterwards, pass each league_id in Events API with pager.

2017-01-08

  • multiple event_ids in /event/view

2016-12-23

  • Add since_time in Event Odds

2016-12-07

  • Add Bet365 InPlay/Event Data

2016-12-02

  • Add 'day' in Events API
  • Add 'source' in Event Odds API

PHP

$url = 'http://api.betsapi.com/v1/events/ended?token=YOUR_TOKEN&sport_id=12';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
if ($data === false) {
    $info = curl_getinfo($ch);
    curl_close($ch);
    die('error occured during curl exec. Additioanl info: ' . var_export($info));
}
curl_close($ch);
print_r( json_decode($data) );