openapi: 3.0.1
info:
  title: Cloudbet Feed API
  description: |-
    The [Cloudbet](https://www.cloudbet.com/en/sports?utmCampaign=axis&utmMedium=community&utmSource=www.cloudbet.com/api/) Feed API uses a long-lived API Key to allow secure access. The `API Key` used follows the JWT authentication standard. You can use these Odds API endpoints to obtain the latest market odds information from Cloudbet.

    This API returns JSON or binary protobuf responses. For JSON responses, send the header `Content-Type: application/json`. For binary protobuf responses, send the header `Content-Type: application/x-protobuf`

    ## Authentication with API Key

    ### Trading API
    1. The Trading API (aka Betting API) is meant for developers who want to place bets and allows you to perform sports betting programatically. You can obtain the Cloudbet Trading `API Key` by logging into your Cloudbet Player account and navigating to the ["My account -> API" section](https://www.cloudbet.com/en/player/api?utmCampaign=axis&utmMedium=community&utmSource=www.cloudbet.com/api/). For further details about how to use the Trading API, please refer to the [Trading API Documentation](https://www.cloudbet.com/api/?urls.primaryName=Trading%20-%20New)


    ### Affiliate API
    1. The Affiliate API is primarily meant if you want to consume Cloudbet odds without needing to place bets programatically. You can obtain the Cloudbet Affiliate `API Key` by logging into your Cloudbet Affiliate account and then visiting the [Affiliate API Token](https://affiliates.cloudbet.com/affiliate_api_token?utmCampaign=axis&utmMedium=community&utmSource=www.cloudbet.com/api/) page. Please note that there are 2 tokens on this page. Make sure to generate the token in the `API Key` section. Also, please take note of the `Expires at` timestamp mentioned in this section which is of a reasonably long duration. Your `API Key` will only be valid until this timestamp and you will have to create a new `API Key` again from the [Affiliate API Token](https://affiliates.cloudbet.com/affiliate_api_token?utmCampaign=axis&utmMedium=community&utmSource=www.cloudbet.com/api/) page before your current token expires to avoid your API calls from being rejected in the future.

    2. Using this Cloudbet Affiliate `API Key` you can then go back to https://www.cloudbet.com/api/ to test the Feed API endpoints as per the next section.

    3. If you authenticate with the Cloudbet Affiliate `API Key`, then the Feed API responses may be cached and up to 1 minute behind the latest updates. This is in contrast to using the Cloudbet Trading `API Key`, which gives you real-time updates.

    ## Testing the Feed API

    1. Our Feed API expects the `API Key` from the previous section to be included in all API requests to the server in an HTTP header that looks like the following:

    `X-API-Key: <API Key>`

    You must replace `<API Key>` with your own `API Key` as obtained in the previous section.

    Example with sample Trading `API Key`. Note that this is a standard JWT token.

    ```
    X-API-Key: eyJhbGciOiJSUzI1NiIsImtpZCI6ImxPVGE3LXVQLVd2QUk1VjhfOHhiYWxjZWlIUmM1OHd6Wi02c21CWGE0Z2MiLCJ0eXAiOiJKV1QifQ.eyJhY2Nlc3NfdGllciI6InRyYWRpbmciLCJleHAiOjE5MzMyMzk2MjgsImlhdCI6MTYxNzg3OTYyOCwiaXNzIjoic3BvcnRzLXBsYXllcnMiLCJqdGkiOiJmZmExZjQ5MC00MzY4LTRhMjEtOGQxYy00NzFlM2FkZTAyYjYiLCJzdWIiOiJiZjA2YjFhZi0zZjM1LTQ2NWUtYTQyZC01Mjc2YTY1ODdmNTIiLCJ0ZW5hbnQiOiJjbG91ZGJldCIsInVzZXJfdXVpZCI6ImJmMDZiMWFmLTNmMzUtNDY1ZS1hNDJkLTUyNzZhNjU4N2Y1MiIsInV1aWQiOiJiZjA2YjFhZi0zZjM1LTQ2NWUtYTQyZC01Mjc2YTY1ODdmNTIifQ.LEwR9AOQ5FGhAKZPGjQ7dl1-0YYUsXbU1fNb17rhUqr_hh7SQipAOv9AlnO8vdExv0bHKrX0zX3_rAnpKdyo5Z6yVVkd-ovpvoTvoiP6gP8yoQqRnrqZKFjHtxHT1wsvqYiBhM52gWzWH77_9ccw5nh78yaxsd2PbZ9meYnqZY_M9x9HGyEU6xFaM1AZ6NaDlGp1iEgqm3atv88vJC75k9H-8Krlh06IwaJxkMnNkrq2cS-rGPDv6tK4jMYpfc7rhXj9ffOr9YOMLQ-fpv7y01hwZD94oUTVoHbAFjBYgMwkh9CdQFbLKZyV0Owb4rFM5BY-4kfKwQlvP9E0TdW3Hw
    ```

    2. After authorization, click on any of the endpoints at https://www.cloudbet.com/api/ (e.g. `/sports`). Click on the `Authorize` button on the top right corner of the page, then enter `<API Key>`. This will authorize you to access our Feed API endpoints from within the OpenAPI GUI itself. Then click on `Try it out` and `Execute`. You will be able to see the API response on this page itself.

    ## Samples and Supporting Documentation
    We provide additional supporting documentation in our [Cloudbet/docs Github repo](https://github.com/Cloudbet/docs)

    ### cURL Samples
    Here are some Feed API cURL samples illustrating the recommended way to ingest odds in bulk from the Cloudbet API.
    Specifically, these samples demonstrate how to request specific Soccer and Baseball markets for the English Premier League (EPL) and Major League Baseball (MLB) competitions respectively.

    1. Fetch Match Odds, Asian Handicap and Total Goals markets for EPL:
    ```
    curl -X 'GET' -H 'accept: application/json' -H 'X-API-Key: <API Key>' \
    'https://sports-api.cloudbet.com/pub/v2/odds/competitions/soccer-england-premier-league?markets=soccer.matchOdds&markets=soccer.asianHandicap&markets=soccer.totalGoals'
    ```

    2. Fetch Moneyline, Totals and Run Line markets for MLB:
    ```
    curl -X 'GET' -H 'accept: application/json' -H 'X-API-Key: <API Key>' \
    'https://sports-api.cloudbet.com/pub/v2/odds/competitions/baseball-usa-mlb?markets=baseball.moneyline&markets=baseball.totals&markets=baseball.runLine'
    ```

    ### Code Samples
    You can refer to [sample JavaScript code on Github](https://github.com/Cloudbet/docs/blob/master/api-sample.js) which guides you on how to obtain sport, competition, event and market information using the API.
    After downloading this script, you can run it locally by adding your API key within the script and then run the command: `node api-sample.js`

    ### Response Samples
    You can refer to [sample Feed API responses on Github](https://github.com/Cloudbet/docs/blob/master/api-responses.md) which gives you a preview of what to expect in our API responses.

    ### API Schemas
    You can refer to [Cloudbet API schemas](https://gist.github.com/kgravenreuth/6703e1e213aecac4d5728f2f699d34e7) which provide details about JSON objects returned within the Cloudbet API. This contains a full list of markets, sports and categories returned by our API.

    ### Protobuf Schema and generated Go Protobuf files
    The Protobuf schema definitions for all Cloudbet API endpoints is available within our [Github repo here](https://github.com/Cloudbet/docs/tree/master/cloudbet). You can also find generated [Go Protobuf files](https://github.com/Cloudbet/docs/tree/master/go/cloudbet). You can use this as a library within your Go client programs.

    ### Event Status details
    Events in the Cloudbet API can transition between different status such as `TRADING`, `TRADING_LIVE` etc. You can find details of these event status [here](https://github.com/Cloudbet/docs/blob/master/README.md#event-status)

    ## Additional Resources
    1. [Trading (aka Betting) API Documentation](https://www.cloudbet.com/api/?urls.primaryName=Trading%20-%20New) The Trading API allows you to bet on Cloudbet odds obtained from the Feed API described on this page.
    2. [Account API Documentation](https://www.cloudbet.com/api/?urls.primaryName=Account) The Account API gives you information about your Cloudbet Account, such as available currencies etc.
    3. [Cloudbet Odds and Betting API Tutorial and Walkthrough blog post](https://www.cloudbet.com/en/blog/posts/sports-betting-api-tutorial-with-golang)
    4. [Cloudbet GraphQL Betting API Tutorial and Walkthrough blog post](https://www.cloudbet.com/en/blog/posts/sports-betting-graphql-api-with-javascript-node-js)
    5. [Postman Collection for Cloudbet Feed, Trading and Account APIs](https://www.postman.com/cloudbet/workspace/cloudbet-api/overview)
    6. [Cloudbet NPM SDK](https://www.npmjs.com/package/@cloudbet/market-helper). You can use this SDK to render markets.
    7. [CodeSandbox Demo of using our Feed API + SDK](https://codesandbox.io/s/cloudbet-odds-api-example-we1vk?file=/src/App.js)
    8. [Github Docs Discussions Page](https://github.com/Cloudbet/docs/discussions). Please feel free to raise any questions you may have about the Cloudbet API here. You can also find existing helpful answers from other Cloudbet API users.
  version: "2.0"
servers:
- url: https://sports-api.cloudbet.com/pub
security:
- ApiKeyAuth: []
paths:
  /v2/odds/competitions/{key}:
    get:
      tags:
      - API-Version-2.0
      summary: Get a competition
      description: Shows live and upcoming events of the given competiiton key
      operationId: GetCompetition
      parameters:
      - name: key
        in: path
        description: key of a competition. It is constructed by sport key + category
          key + competition key; e.g. soccer-england-premier-league
        required: true
        schema:
          type: string
      - name: from
        in: query
        description: |-
          time range, Unix epoch time, i.e. seconds since January 1, 1970 midnight UTC; e.g. 1618997973
          `from` + `to` must be sent together
        schema:
          type: integer
          format: int64
      - name: to
        in: query
        description: |-
          time range, Unix epoch time, i.e. seconds since January 1, 1970 midnight UTC; e.g. 1619042340
          `from` + `to` must be sent together
        schema:
          type: integer
          format: int64
      - name: markets
        in: query
        description: |-
          If not empty, only display markets specified here. Note that all events in a given time-range will still be returned, even if the specified market is absent
          Must specify each market as a separate query param; e.g. ?markets=basketball.handicap&markets=basketball.moneyline
          Full list of markets: https://gist.github.com/kgravenreuth/6703e1e213aecac4d5728f2f699d34e7#file-markets-json
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: players
        in: query
        description: "if true, include players information"
        schema:
          type: boolean
          default: false
      - name: limit
        in: query
        description: Limit the number of events; e.g. 50
        schema:
          maximum: 10000
          type: integer
          format: int64
      responses:
        "200":
          description: CompetitionResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompetitionResponse'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/CompetitionResponse'
        "400":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "401":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "500":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/odds/events:
    get:
      tags:
      - API-Version-2.0
      summary: Get list of upcoming or live events with markets for a given Sport.
      description: |-
        `live` query param returns all TRADING_LIVE events for a given sport.
        `from` + `to` query params are required if `live = false` in your request to specify a valid time-range to retrieve upcoming (TRADING + PRE_TRADING) events
      operationId: GetEvents
      parameters:
      - name: sport
        in: query
        description: "sport to query events for, e.g. `tennis`"
        required: true
        schema:
          type: string
      - name: from
        in: query
        description: |-
          time range for upcoming events, Unix epoch time, i.e. seconds since January 1, 1970 midnight UTC; e.g. 1618997973
          Either `live` or `from` + `to` query params are REQUIRED in your request to specify a valid time-range.
          `from` can't be sent together with `live`. Also, `from` + `to` must be sent together
        schema:
          type: integer
          format: int64
      - name: to
        in: query
        description: |-
          time range for upcoming events, Unix epoch time, i.e. seconds since January 1, 1970 midnight UTC; e.g. 1619042340
          Either `live` or `from` + `to` query params are REQUIRED in your request to specify a valid time-range.
          `to` can't be sent together with `live`. Also, `from` + `to` must be sent together
        schema:
          type: integer
          format: int64
      - name: live
        in: query
        description: |-
          If true, return all TRADING_LIVE events
          If false, return TRADING + PRE_TRADING events
          false by default
          `live` can't be sent together with `from` or `to` query params
        schema:
          type: boolean
          default: false
      - name: markets
        in: query
        description: |-
          If not empty, only display markets specified here. Note that all events in a given time-range will still be returned, even if the specified market is absent
          Must specify each market as a separate query param; e.g. ?markets=basketball.handicap&markets=basketball.moneyline
          Full list of markets: https://gist.github.com/kgravenreuth/6703e1e213aecac4d5728f2f699d34e7#file-markets-json
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: players
        in: query
        description: "if true, include players information"
        schema:
          type: boolean
          default: false
      - name: limit
        in: query
        description: Limit the number of events
        schema:
          maximum: 10000
          type: integer
          format: int64
          default: 10000
      responses:
        "200":
          description: FixturesResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FixturesResponse'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/FixturesResponse'
        "400":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "401":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "500":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/odds/events/{id}:
    get:
      tags:
      - API-Version-2.0
      summary: Get an event
      description: Shows all available main markets by default
      operationId: GetEvent
      parameters:
      - name: id
        in: path
        description: id of an event; e.g. 5837480
        required: true
        schema:
          type: integer
          format: uint64
      - name: markets
        in: query
        description: |-
          If not empty, only display markets specified here. Note that all events in a given time-range will still be returned, even if the specified market is absent
          Must specify each market as a separate query param; e.g. ?markets=basketball.handicap&markets=basketball.moneyline
          Full list of markets: https://gist.github.com/kgravenreuth/6703e1e213aecac4d5728f2f699d34e7#file-markets-json
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: EventResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventResponse'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/EventResponse'
        "400":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "401":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "500":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/odds/fixtures:
    get:
      tags:
      - API-Version-2.0
      summary: Get fixtures (i.e. sporting events without markets or metadata) for
        a given sport on a given date
      description: |-
        Shows live, upcoming and pre-trading fixtures of a given sport for a given date or time-range.
        Also note that a "day" counts as `00:00:00` UTC to `23:59:59` UTC on the requested date.
      operationId: GetFixtures
      parameters:
      - name: sport
        in: query
        description: "sport to query fixtures for, e.g. `tennis`"
        required: true
        schema:
          type: string
      - name: date
        in: query
        description: |-
          date for which you want to query events in ISO 8601 (YYYY-MM-DD) format, e.g. 2021-05-27
          The timerange on the date for which events are returned is from 00:00:00 UTC to 23:59:59 UTC
          If `limit` is not sent as a separate query string, it is set to `10000` to get all events for a day
          Either `date` or `from` + `to` query params are REQUIRED in your request to specify a valid time-range.
          `date` can't be sent together with `from` or `to`
        schema:
          type: string
      - name: from
        in: query
        description: |-
          time range for events, Unix epoch time, i.e. seconds since January 1, 1970 midnight UTC; e.g. 1618997973
          Either `date` or `from` + `to` query params are REQUIRED in your request to specify a valid time-range.
          `date` can't be sent together with `from` or `to`
        schema:
          type: integer
          format: int64
      - name: to
        in: query
        description: |-
          time range for events, Unix epoch time, i.e. seconds since January 1, 1970 midnight UTC; e.g. 1619042340
          Either `date` or `from` + `to` query params are REQUIRED in your request to specify a valid time-range.
          `date` can't be sent together with `from` or `to`
        schema:
          type: integer
          format: int64
      - name: players
        in: query
        description: "if true, include players information"
        schema:
          type: boolean
          default: false
      - name: limit
        in: query
        description: Limit the number of events
        schema:
          maximum: 10000
          type: integer
          format: int64
          default: 10000
      responses:
        "200":
          description: FixturesResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FixturesResponse'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/FixturesResponse'
        "400":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "401":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "500":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/odds/lines:
    post:
      tags:
      - API-Version-2.0
      summary: "Obtain latest odds for a selection based on market key, outcome and\
        \ params."
      operationId: PostLine
      requestBody:
        description: line fetch request JSON body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostLine'
          application/x-protobuf:
            schema:
              $ref: '#/components/schemas/PostLine'
        required: true
      responses:
        "200":
          description: LineResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LineResponse'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/LineResponse'
        "400":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "401":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "500":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
      x-codegen-request-body-name: request
  /v2/odds/sports:
    get:
      tags:
      - API-Version-2.0
      summary: Get list of sports.
      description: Sports are ordered by alphabetical order.
      operationId: GetSports
      responses:
        "200":
          description: SportsResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SportsResponse'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/SportsResponse'
        "400":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "401":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "500":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/odds/sports/{key}:
    get:
      tags:
      - API-Version-2.0
      summary: Get competitions of a sport.
      description: Competitions are grouped by categories.
      operationId: GetSport
      parameters:
      - name: key
        in: path
        description: key of a sport; e.g. soccer
        required: true
        schema:
          type: string
      responses:
        "200":
          description: SportWithCategoryResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SportWithCategoryResponse'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/SportWithCategoryResponse'
        "400":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "401":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
        "500":
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/x-protobuf:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Category:
      type: object
      properties:
        competitions:
          type: array
          description: list of all competitions associated with this Category
          items:
            $ref: '#/components/schemas/CompetitionForSport'
        key:
          type: string
          description: slug for this Category
          example: '"atp"'
        name:
          type: string
          description: name of this Category
          example: '"ATP"'
      description: "Category is used for the /sports/{key} endpoint"
    Competition:
      type: object
      properties:
        category:
          $ref: '#/components/schemas/Identifier'
        events:
          type: array
          description: list of all events associated with this competition
          items:
            $ref: '#/components/schemas/EventForCompetition'
        key:
          type: string
          description: slug for this Competition. Composed of <sport-key>-<category-key>-<competition-key>
            as shown in the example value.
          example: '"tennis-atp-french-open-men-singles"'
        name:
          type: string
          description: name of this Competition
          example: "\"French Open, Men Singles\""
        sport:
          $ref: '#/components/schemas/Identifier'
      description: "Competition is used for the /sports/competitions/{key} endpoint"
    CompetitionForSport:
      type: object
      properties:
        eventCount:
          type: integer
          description: "number of events associated with this Competition, 0 events\
            \ indicates inactive Competition"
          format: uint32
          example: 2
        key:
          type: string
          description: slug for this Competition. Composed of <sport-key>-<category-key>-<competition-key>
            as shown in the example value.
          example: '"tennis-atp-french-open-men-singles"'
        name:
          type: string
          description: name of this Competition
          example: "\"French Open, Men Singles\""
      description: "CompetitionForSport is used for the /sports/{key} endpoint"
    CompetitionResponse:
      type: object
      properties:
        category:
          $ref: '#/components/schemas/Identifier'
        events:
          type: array
          description: list of all events associated with this competition
          items:
            $ref: '#/components/schemas/EventForCompetition'
        key:
          type: string
          description: slug for this Competition. Composed of <sport-key>-<category-key>-<competition-key>
            as shown in the example value.
          example: '"tennis-atp-french-open-men-singles"'
        name:
          type: string
          description: name of this Competition
          example: "\"French Open, Men Singles\""
        sport:
          $ref: '#/components/schemas/Identifier'
      description: CompetitionResponse presents competition with list of events
    CompetitionWithCategory:
      type: object
      properties:
        category:
          $ref: '#/components/schemas/Identifier'
        key:
          type: string
          description: slug for this Competition. Composed of <sport-key>-<category-key>-<competition-key>
            as shown in the example value.
          example: '"tennis-atp-french-open-men-singles"'
        name:
          type: string
          description: name of this Competition
          example: "\"French Open, Men Singles\""
      description: "CompetitionWithCategory is used for the /sports/events/{id} endpoint\
        \ to link events with competitions"
    Error:
      type: object
      properties:
        error:
          type: string
          description: "Additional Error Details, if applicable for a given error"
          example: empty request body
        status:
          type: string
          description: Error Status
          example: MALFORMED_REQUEST
      description: Error presents response errors for all error status codes.
    Event:
      type: object
      properties:
        away:
          $ref: '#/components/schemas/TeamIdentifier'
        competition:
          $ref: '#/components/schemas/CompetitionWithCategory'
        cutoffTime:
          type: string
          description: event cutoff time in string format "2006-01-02T15:04:05Z07:00"
            (RFC3339)
          example: '"2021-06-09T09:00:00Z"'
        home:
          $ref: '#/components/schemas/TeamIdentifier'
        id:
          type: integer
          description: unique ID for this Event
          format: uint32
          example: 7498746
        key:
          type: string
          description: slug for this Event
          example: '"c886a-nadal-rafael-v-c8973-schwartzman-diego"'
        markets:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Market'
          description: mapping between market key and all associated markets for this
            Event
        metadata:
          $ref: '#/components/schemas/EventMetadata'
        name:
          type: string
          description: name of this Event
          example: '"Rafael Nadal V Diego Schwartzman"'
        sequence:
          type: integer
          description: sequential update number for this Event
          format: int64
          example: 127
        sport:
          $ref: '#/components/schemas/Identifier'
        status:
          $ref: '#/components/schemas/EventStatus'
      description: "Event is used for the /sports/events/{id} endpoint"
    EventForCompetition:
      type: object
      properties:
        away:
          $ref: '#/components/schemas/TeamIdentifier'
        cutoffTime:
          type: string
          description: event cutoff time in string format "2006-01-02T15:04:05Z07:00"
            (RFC3339)
          example: '"2021-06-09T09:00:00Z"'
        home:
          $ref: '#/components/schemas/TeamIdentifier'
        id:
          type: integer
          description: unique ID for this Event
          format: uint32
          example: 7498746
        key:
          type: string
          description: slug for this Event
          example: '"c886a-nadal-rafael-v-c8973-schwartzman-diego"'
        markets:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Market'
          description: mapping between market key and all associated markets for this
            Event
        metadata:
          $ref: '#/components/schemas/EventMetadata'
        name:
          type: string
          description: name of this Event
          example: '"Rafael Nadal V Diego Schwartzman"'
        sequence:
          type: integer
          description: sequential update number for this Event
          format: int64
          example: 127
        status:
          $ref: '#/components/schemas/EventStatus'
      description: "EventForCompetition is used for the /sports/competitions/{key}\
        \ endpoint"
    EventMetadata:
      type: object
      properties:
        opinion:
          type: array
          description: "(deprecated, use opinions instead) opinion is an answer to\
            \ the question \"How do players bet on Cloudbet v/s the currently offered\
            \ odds?\""
          items:
            $ref: '#/components/schemas/OutcomeProbability'
        opinions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Opinion'
          description: opinions represent the betting patterns of players on different
            outcomes of different markets
      description: Event metadata contains additional event info
    EventResponse:
      type: object
      properties:
        away:
          $ref: '#/components/schemas/TeamIdentifier'
        competition:
          $ref: '#/components/schemas/CompetitionWithCategory'
        cutoffTime:
          type: string
          description: event cutoff time in string format "2006-01-02T15:04:05Z07:00"
            (RFC3339)
          example: '"2021-06-09T09:00:00Z"'
        endTime:
          type: string
          description: "the time when the event ends in string format \"2006-01-02T15:04:05Z07:00\"\
            \ (RFC3339), optional."
          example: '"2021-06-09T10:45:00Z"'
        gradingDuration:
          type: integer
          description: |-
            estimated grading duration in minutes between event finish time and bet complete time (not available for outrights)
            for example, value `30` means most of the bets will be graded after 30 minutes
          format: int32
          example: 30
        home:
          $ref: '#/components/schemas/TeamIdentifier'
        id:
          type: integer
          description: unique ID for this Event
          format: uint32
          example: 7498746
        key:
          type: string
          description: slug for this Event
          example: '"c886a-nadal-rafael-v-c8973-schwartzman-diego"'
        markets:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Market'
          description: mapping between market key and all associated markets for this
            Event
        metadata:
          $ref: '#/components/schemas/EventMetadata'
        name:
          type: string
          description: name of this Event
          example: '"Rafael Nadal V Diego Schwartzman"'
        resultedTime:
          type: string
          description: resulted time available after end of event in string format
            "2006-01-02T15:04:05Z07:00" (RFC3339)
          example: '"2021-06-09T11:00:00Z"'
        sequence:
          type: integer
          description: sequential update number for this Event
          format: int64
          example: 127
        settlement:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Scores'
          description: |-
            reserved field for possible future use, empty currently

            The map key will be the score types, such as period=default
        sport:
          $ref: '#/components/schemas/Identifier'
        status:
          $ref: '#/components/schemas/EventStatus'
        type:
          $ref: '#/components/schemas/EventType'
      description: EventResponse presents an Event with markets and submarkets
    EventStatus:
      type: string
      description: EventStatus presents the current status for a given Event
      enum:
      - PRE_TRADING
      - TRADING
      - TRADING_LIVE
      - RESULTED
      - INTERRUPTED
      - AWAITING_RESULTS
      - POST_TRADING
      - CANCELLED
    EventType:
      type: integer
      description: EventType presents the type of an event which affects the markets
        format
      format: int32
    FixtureListEntry:
      type: object
      properties:
        away:
          $ref: '#/components/schemas/TeamIdentifier'
        cutoffTime:
          type: string
          description: event cutoff time in string format "2006-01-02T15:04:05Z07:00"
            (RFC3339)
          example: '"2021-06-09T09:00:00Z"'
        home:
          $ref: '#/components/schemas/TeamIdentifier'
        id:
          type: integer
          description: unique ID for this Event
          format: uint32
          example: 7498746
        key:
          type: string
          description: slug for this Event
          example: '"c886a-nadal-rafael-v-c8973-schwartzman-diego"'
        name:
          type: string
          description: name of this Event
          example: '"Rafael Nadal V Diego Schwartzman"'
        status:
          $ref: '#/components/schemas/EventStatus'
      description: |-
        FixtureListEntry is used for the /fixtures endpoint
        It gives an individual sporting event without markets or metadata information
    FixturesCompetition:
      type: object
      properties:
        category:
          $ref: '#/components/schemas/Identifier'
        events:
          type: array
          description: list of events which belong to this competition
          items:
            $ref: '#/components/schemas/FixtureListEntry'
        key:
          type: string
          description: slug for this Competition. Composed of <sport-key>-<category-key>-<competition-key>
            as shown in the example value.
          example: '"tennis-atp-french-open-men-singles"'
        name:
          type: string
          description: name of this Competition
          example: "\"French Open, Men Singles\""
      description: |-
        FixturesCompetition is used for the /fixtures endpoint
        It gives a list of all events for a given competition
    FixturesResponse:
      type: object
      properties:
        competitions:
          type: array
          description: list of all requested competitions and events
          items:
            $ref: '#/components/schemas/FixturesCompetition'
      description: FixturesResponse presents a list of upcoming fixtures for a given
        sport and date
    Identifier:
      type: object
      properties:
        key:
          type: string
          description: slug for this Identifier
          example: '"Tennis"'
        name:
          type: string
          description: name of this Identifier
          example: '"tennis"'
      description: Identifier represents a name-key tuple which together identify
        a given entity such as a sport
    LineResponse:
      type: object
      properties:
        maxStake:
          type: number
          description: maximum stake in EUR which can be placed in bets on this Selection;
            market liability = selection max stake * (price - 1);
          format: double
          example: 1803.6394618802
        minStake:
          type: number
          description: minimum stake in EUR which can be placed in bets on this Selection
          format: double
          example: 0.1
        outcome:
          type: string
          description: outcome of this Selection
          example: '"home"'
        params:
          type: string
          description: |-
            parameters to be sent by the client during bet placement on this selection, such as handicap, period etc.
            Special Note about handicap markets:
            For handicap markets a line is identified by the same params. Selections can be grouped by market key and params alone. Home and away outcomes then have the same market URL for the same handicap lines. The handicap value is dictated by the home team value and inverted on the away side.
          example: '"handicap=-3"'
        marketUrl:
          type: string
          description: "Providing a market URL for betting, it is composed from the\
            \ initial Feed API selection response as `marketKey/outcome?params`"
          example: soccer.asian_handicap/home?handicap=-3
        price:
          type: number
          description: price at which bets can be placed on this Selection
          format: double
          example: 1.892
        probability:
          type: number
          description: probability of this Selection's outcome
          format: double
          example: 0.493
        side:
          $ref: '#/components/schemas/Side'
        status:
          $ref: '#/components/schemas/SelectionStatus'
      description: "LineResponse presents a selection for a given market key, outcome\
        \ and params"
    Market:
      type: object
      properties:
        submarkets:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Submarket'
          description: mapping between submarket key and all associated submarkets
            for this Market
      description: |-
        Market is used as a part of Event and EventForCompetition
        used to build a list of all markets for a given Event
    Opinion:
      type: object
      properties:
        categories:
          type: array
          description: list of outcome probabilities
          items:
            $ref: '#/components/schemas/OutcomeProbability'
      description: Opinion represents the opinions for all outcomes of a given market
    OutcomeProbability:
      type: object
      properties:
        marketKey:
          type: string
          description: market key used to build opinion
          example: basketball.handicap
        outcome:
          type: string
          description: outcome
          example: home
        params:
          type: string
          description: "market parameters used to build opinion, such as handicap,\
            \ period etc."
          example: handicap=-3
        probability:
          type: number
          description: probability
          format: float
          example: 0.47347018
      description: "Similar to Selection, but represents opinion (probability) for\
        \ particular outcome of the market"
    PostLine:
      required:
      - eventId
      - marketUrl
      type: object
      properties:
        eventId:
          type: string
          description: Event ID for which the line fetch is requested
          example: "6162894"
        marketUrl:
          type: string
          description: |-
            `marketUrl` is composed from the initial Feed API selection response as `marketKey/outcome?params`.
            If no params (empty string) were present in the initial Feed API response, then omit the `params` query string format the `marketUrl` as `marketKey/outcome`
            Special Note about handicap markets:
            For handicap markets a line is identified by the same params. Selections can be grouped by market key and params alone. Home and away outcomes then have the same market URL for the same handicap lines. The handicap value is dictated by the home team value and inverted on the away side.
          example: basketball.handicap/home?handicap=-3
      description: LineRequest presents the line fetch request JSON body
    Scores:
      type: object
      properties:
        layout:
          type: array
          description: layout for scores
          example: "event: ['home', 'away']; outright: ['outcome=swansea']; racing:\
            \ ['player=lucky-k-1', 'player=darwin-c-1', 'player=loca-m-1']"
          items:
            type: string
        scores:
          type: array
          description: scores details
          example: "event: [1, 2]; outright: [1]; racing: [1, 1, 2]"
          items:
            type: integer
            format: uint32
      description: Scores is a reserved field for possible future use with Settlement
    Selection:
      type: object
      properties:
        maxStake:
          type: number
          description: maximum stake in EUR which can be placed in bets on this Selection;
            market liability = selection max stake * (price - 1);
          format: double
          example: 1803.6394618802
        minStake:
          type: number
          description: minimum stake in EUR which can be placed in bets on this Selection
          format: double
          example: 0.1
        outcome:
          type: string
          description: outcome of this Selection
          example: '"home"'
        params:
          type: string
          description: |-
            parameters to be sent by the client during bet placement on this selection, such as handicap, period etc.
            Special Note about handicap markets:
            For handicap markets a line is identified by the same params. Selections can be grouped by market key and params alone. Home and away outcomes then have the same market URL for the same handicap lines. The handicap value is dictated by the home team value and inverted on the away side.
          example: '"handicap=-3"'
        marketUrl:
          type: string
          description: "Providing a market URL for betting, it is composed from the\
            \ initial Feed API selection response as `marketKey/outcome?params`"
          example: soccer.asian_handicap/home?handicap=-3
        price:
          type: number
          description: price at which bets can be placed on this Selection
          format: double
          example: 1.892
        probability:
          type: number
          description: probability of this Selection's outcome
          format: double
          example: 0.493
        side:
          $ref: '#/components/schemas/Side'
        status:
          $ref: '#/components/schemas/SelectionStatus'
      description: |-
        Selection is used as a part of Submarket
        used to build a list of all selections for a given Submarket
    SelectionStatus:
      type: string
      description: SelectionStatus presents the current status for a given selection
      enum:
      - SELECTION_DISABLED
      - SELECTION_ENABLED
    Side:
      type: string
      description: |-
        Side of a selection signals whether a selection
        is available for back or lay side betting
      enum:
      - BACK
      - LAY
    Sport:
      type: object
      properties:
        competitionCount:
          type: integer
          description: "number of competitions associated with this Sport, 0 indicates\
            \ inactive Sport"
          format: uint32
          example: 2
        eventCount:
          type: integer
          description: "number of events associated with this Sport, 0 indicates inactive\
            \ Sport"
          format: uint32
          example: 2
        key:
          type: string
          description: slug for this Sport
          example: tennis
        name:
          type: string
          description: name of this Sport
          example: Tennis
      description: Sport is used for an individual sport's details in the /sports
        endpoint
    SportWithCategory:
      type: object
      properties:
        categories:
          type: array
          description: list of all categories associated with this Sport
          items:
            $ref: '#/components/schemas/Category'
        competitionCount:
          type: integer
          description: "number of competitions associated with this Sport, 0 indicates\
            \ inactive Sport"
          format: uint32
          example: 2
        eventCount:
          type: integer
          description: "number of events associated with this Sport, 0 indicates inactive\
            \ Sport"
          format: uint32
          example: 2
        key:
          type: string
          description: slug for this Sport
          example: tennis
        name:
          type: string
          description: name of this Sport
          example: Tennis
      description: |-
        SportWithCategory is used for the /sports/{key} endpoint
        with this hierarchy: sport->categories->competitions
    SportWithCategoryResponse:
      type: object
      properties:
        categories:
          type: array
          description: list of all categories associated with this Sport
          items:
            $ref: '#/components/schemas/Category'
        competitionCount:
          type: integer
          description: "number of competitions associated with this Sport, 0 indicates\
            \ inactive Sport"
          format: uint32
          example: 2
        eventCount:
          type: integer
          description: "number of events associated with this Sport, 0 indicates inactive\
            \ Sport"
          format: uint32
          example: 4
        key:
          type: string
          description: slug for this Sport
          example: tennis
        name:
          type: string
          description: name of this Sport
          example: Tennis
      description: SportWithCategoryResponse presents all competitions grouped by
        categories
    Sports:
      type: object
      properties:
        sports:
          type: array
          description: list of all sports offerred
          items:
            $ref: '#/components/schemas/Sport'
      description: Sports is used as the root object in the /sports endpoint
    SportsResponse:
      type: object
      properties:
        sports:
          type: array
          description: list of all sports offerred
          items:
            $ref: '#/components/schemas/Sport'
      description: SportsResponse presents all sports with their competition count
    Submarket:
      type: object
      properties:
        selections:
          type: array
          description: list of all associated selections
          items:
            $ref: '#/components/schemas/Selection'
        sequence:
          type: integer
          description: sequential update number
          format: int64
          example: 127
      description: |-
        Submarket contains selections which are inter-dependent on each other and is used as a part of Market
        used to build a map of all submarkets for a given Market
    Team:
      type: string
      description: Team presents the team for a given player
      enum:
      - TEAM_UNDEFINED
      - HOME
      - AWAY
    TeamIdentifier:
      type: object
      properties:
        abbreviation:
          type: string
          description: abbreviation for this team's name
          example: '"NAD"'
        key:
          type: string
          description: slug for this Identifier
          example: '"c886a-nadal-rafael"'
        name:
          type: string
          description: name of this Identifier
          example: '"Rafael Nadal"'
        nationality:
          type: string
          description: team country code
          example: '"ESP"'
      description: TeamIdentifier identifies a team competitor for a given event
  responses:
    ErrResponse:
      description: ErrResponse error type presents response errors for all error status
        codes.
      headers:
        status_code:
          description: HTTP response status code
          schema:
            type: integer
            format: int64
        status:
          description: HTTP response status text
          schema:
            type: string
      content: {}
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: X-API-Key
      in: header
x-original-swagger-version: "2.0"