Pinnacle API Documentation

repository·master·Indexed 41 days ago

https://github.com/pinnacleapi/pinnacleapi-documentation

A RESTful service providing betting data and execution capabilities for professional bettors and commercial partners. Includes specifications for Customer API v1, Lines API v2, and Bets API v4, covering odds, fixtures, and bet placement with features like delta calls, automatic deduplication, and sport-specific market structures.

Tokens
7.8K
Snippets
16
Records
41
Agent score
51%

What's inside Pinnacle API

  1. Understand the Pinnacle API Fair Use Policy

    master
    The Pinnacle API is a protected resource provided exclusively to players, partners, and affiliates. By using the API, you agree to the Fair Use Policy. Pinnacle reserves the right to block access without prior notice if usage is deemed inconsistent with this policy. Terms may be modified at any time, and continued use of the API constitutes acceptance of those changes.
  2. How Soccer Extra Time markets are structured

    master

    Historically, Soccer Extra Time markets (e.g., "France (To Advance)", "England (ET ONLY)") were distinct events. They are now provided as Periods of the parent live event.

    Important Data Note: Goals and Red Cards occurring during Extra Time are only returned in Period 3.

    Period Mapping for Soccer Extra Time:

    • Period 3: Extra Time
    • Period 6: Penalty Shootout
    • Period 7: 1st Ten Shootout Pen
    • Period 8: To Qualify
    • Period 39: To Win Final

    Market Availability by Period:

    • Period 3: Spread, Moneyline, Total, and Team Totals.
    • Periods 6, 8, 39: Moneyline only.
    • Period 7: Total only.
    // Example of an event with multiple periods (from Get Odds response)
    "periods": [
        {
            "lineId": 1912670188,
            "number": 8, // To Qualify
            "moneyline": { "home": -322.0, "away": 212.0 }
        },
        {
            "lineId": 1912670213,
            "number": 3, // Extra Time
            "spreads": [...],
            "moneyline": { "home": 130.0, "away": 497.0, "draw": -109.0 },
            "totals": [...]
        }
    ]
  3. Group associated events using parentId

    master

    Use the parentId field from the [Get Fixtures] endpoint to group related events (such as pre-game and live versions of the same match, or different market types like corners) to a single 'parent' event.

    Key Rules:

    • Parent events are pre-game events (liveStatus=0 or liveStatus=2) and do not have a parentId set.
    • Live events (liveStatus=1) will always have a parentId set.
    • Multiple events can be associated with one parent (e.g., if they have different resultingUnit or offer alternative odds).
    • The parentId property is intended to replace the rotNum property, which is being decommissioned.
    {
        "sportId": 29,
        "league": [
            {
                "id": 2331,
                "events": [
                    {
                        "id": 837721686,
                        "liveStatus": 1,
                        "parentId": 834342247
                    },
                    {
                        "id": 834342247,
                        "liveStatus": 2,
                        "parentId": null
                    }
                ]
            }
        ]
    }
  4. Avoid commercial usage violations

    master

    Commercial usage of the API is strictly prohibited unless you have an explicit written agreement from Pinnacle. Unauthorized commercial use will result in the permanent suspension of your API access.

    Specifically, you must not:

    • Use the API for commercial purposes without a written agreement.
    • Sell, rent, lease, sublicense, redistribute, or syndicate the API to any third party without prior written approval.
  5. Map home/away teams to team1/team2

    master

    In /odds and /fixtures operations, teams are referred to as home and away. However, when placing a bet, you must specify the team (e.g., team1 or team2).

    The mapping between home/away and team1/team2 is provided in the /leagues response via the homeTeamType property.

  6. Use Delta and Snapshot calls for Odds and Fixtures

    master

    The /fixtures, /fixtures/special, /odds, and /odds/special endpoints support two modes of operation:

    1. Snapshot Calls: Returns the current state of the data. Do not provide a since parameter for snapshot calls.
    2. Delta Calls: Returns only the changes that have occurred since a specific point in time.

    Best Practices:

    • Workflow: Always issue a snapshot call first, then proceed with delta calls to receive updates efficiently with smaller payloads.
    • The since parameter: For delta calls, the since parameter must not be 0 or 1. It must always be the value of the last property returned in your previous response.
  7. Use parentId to group associated events

    master

    The parentId property in the /fixtures response is used to group associated events to a single "parent" pre-game event. This replaces the need for using rotation numbers to link related events (such as a main match and its associated corner or booking markets).

    Example of grouping via parentId in a /fixtures response:

    {
        "sportId": 29,
        "last": 148671597,
        "league": [
            {
                "id": 2331,
                "name": "Norway - 1st Division",
                "events": [
                    {
                        "id": 837721686,
                        "starts": "2018-04-10T17:00:00Z",
                        "home": "Viking Fk",
                        "away": "Mjondalen",
                        "rotNum": "6751",
                        "liveStatus": 1,
                        "status": "O",
                        "parlayRestriction": 2,
                        "parentId": 834342247,
                        "altTeaser": false
                    },
                    {
                        "id": 834342247,
                        "starts": "2018-04-10T17:00:00Z",
                        "home": "Viking Fk",
                        "away": "Mjondalen",
                        "rotNum": "6751",
                        "liveStatus": 2,
                        "status": "I",
                        "parlayRestriction": 2,
                        "parentId": 834342247,
                        "altTeaser": false
                    }
                ]
            },
            {
                "id": 6816,
                "name": "Norway - 1st Division Corners",
                "events": [
                    {
                        "id": 837721684,
                        "starts": "2018-04-10T17:00:00Z",
                        "home": "Viking Fk (Corners)",
                        "away": "Mjondalen (Corners)",
                        "rotNum": "6751",
                        "liveStatus": 1,
                        "status": "O",
                        "parlayRestriction": 1,
                        "parentId": 834342247,
                        "altTeaser": false
                    },
                    {
                        "id": 837721615,
    n                    "starts": "2018-04-10T17:00:00Z",
                        "home": "Viking Fk (Corners)",
                        "away": "Mjondalen (Corners)",
                        "rotNum": "6751",
                        "liveStatus": 2,
                        "status": "I",
                        "parlayRestriction": 1,
                        "parentId": 834342247,
                        "altTeaser": false
                    }
                ]
            }
        ]
    }
    {
        "sportId": 29,
        "last": 148671597,
        "league": [
            {
                "id": 2331,
                "name": "Norway - 1st Division",
                "events": [
                    {
                        "id": 837721686,
                        "starts": "2018-04-10T17:00:00Z",
                        "home": "Viking Fk",
                        "away": "Mjondalen",
                        "rotNum": "6751",
                        "liveStatus": 1,
                        "status": "O",
                        "parlayRestriction": 2,
                        "parentId": 834342247,
                        "altTeaser": false
                    },
                    {
                        "id": 834342247,
                        "starts": "2018-04-10T17:00:00Z",
                        "home": "Viking Fk",
                        "away": "Mjondalen",
                        "rotNum": "6751",
                        "liveStatus": 2,
                        "status": "I",
                        "parlayRestriction": 2,
                        "parentId": 834342247,
                        "altTeaser": false
                    }
                ]
            },
            {
                "id": 6816,
                "name": "Norway - 1st Division Corners",
                "events": [
                    {
                        "id": 837721684,
                        "starts": "2018-04-10T17:00:00Z",
                        "home": "Viking Fk (Corners)",
                        "away": "Mjondalen (Corners)",
                        "rotNum": "6751",
                        "liveStatus": 1,
                        "status": "O",
                        "parlayRestriction": 1,
                        "parentId": 834342247,
                        "altTeaser": false
                    },
                    {
                        "id": 837721615,
                        "starts": "2018-04-10T17:00:00Z",
                        "home": "Viking Fk (Corners)",
                        "away": "Mjondalen (Corners)",
                        "rotNum": "6751",
                        "liveStatus": 2,
                        "status": "I",
                        "parlayRestriction": 1,
                        "parentId": 834342247,
                        "altTeaser": false
                    }
                ]
            }
        ]
    }
  8. Check event betting availability via status property

    master
    To determine if an event is open for betting, check the status property on the period in the /odds and /odds/parlay/ response. This property specifies whether the period is online or offline for betting, allowing clients to avoid frequent calls to the /fixtures endpoint to check event status.
  9. Determine if a market is open for betting

    master

    A standard market is open for betting if all the following conditions are met:

    1. The period status is 1.
    2. The market is priced.
    3. The period cutoff is in the future.

    Special Markets are open if:

    1. The special event status is either "O" or "I" (see [Get Special Fixtures]).
    2. The market is priced (see [Get Special Odds]).
    3. The special event cutoff is in the future.
  10. New Tennis Event Structure (Post-September 2022)

    master

    As of the September 12, 2022 update, Tennis events have moved away from embedding handicap information and period descriptions directly into the team names. Instead, the API uses explicit resultingUnit values and separate event objects to represent different markets.

    Key changes:

    • Explicit resultingUnit: Markets now explicitly state whether they use Sets, Games, or Regular units.
    • Spread Markets: Set Handicap markets no longer use Moneylines with handicap points in the name; they are now offered as spread markets.
    • Period Handling: For Live tennis, instead of using Period 0 with descriptions in the team names, the API uses the number field within the periods array to distinguish between different resulting units.

    To find the specific descriptions for Tennis Periods, use the following endpoint: /v1/periods?sportId=33

    {
        "id": 1562180480,
        "starts": "2022-10-31T20:30:00Z",
        "home": "Sebastian Korda",
        "away": "Alex De Minaur",
        "resultingUnit": "Sets", 
        "version": 440033645
    },
    {
        "id": 1562180497,
        "starts": "2022-10-31T20:30:00Z",
        "home": "Sebastian Korda (Games)",
        "away": "Alex De Minaur (Games)",
        "parentId": 1562180480,
        "resultingUnit": "Games", 
        "version": 440033657
    }
  11. Understand API Deduplication for Bets

    master

    To prevent duplicate bets caused by network timeouts or retries, the API implements automatic deduplication for all 'place bet' requests.

    When you issue a request, you should provide a uniqueRequestId. If a bet is accepted, the system stores that uniqueRequestId for 30 minutes. If you attempt to place another bet with the same uniqueRequestId within that 30-minute window, the API will return an error instead of creating a duplicate bet.

  12. Adhere to API Usage Rules and Restrictions

    master

    To maintain service stability, clients must follow these usage rules:

    • Avoid Looping: Do not call /odds or /fixture endpoints in a loop for individual sports, leagues, or fixtures. Instead, use the leagueIds or eventIds parameters to request multiple IDs in a single call.
    • Line Endpoint: The /line endpoint is intended solely for checking a price prior to placing a bet; do not call it in a loop.
    • Sports Endpoint: Requests to /sports must be limited to once every 60 minutes.
    • IP Restrictions: Access is restricted to a maximum of 2 distinct IP addresses per client.