{"openapi":"3.0.2","tags":[{"name":"viewer"},{"name":"ranking"},{"name":"viewer_ranking_items"}],"info":{"title":"Rankings","termsOfService":"https:\/\/developer.toornament.com\/terms-guidelines","version":"2.1.0","description":"The Toornament platform connects your website and application with the eSports tournaments around the world.","contact":{"name":"Toornament Developer","url":"https:\/\/developer.toornament.com","email":"contact@toornament.com"}},"servers":[{"url":"https:\/\/api.toornament.com\/viewer\/v2"}],"paths":{"\/tournaments\/{tournament_id}\/stages\/{stage_id}\/ranking-items":{"get":{"deprecated":true,"tags":["viewer_ranking_items"],"summary":"Retrieve ranking items of a stage and tournament.","description":"Returns ranking items of a stage with a small summary of the associated participant in the ranking. The items are always ordered by ascending position.","parameters":[{"$ref":"#\/components\/parameters\/rankingItemRange"},{"$ref":"#\/components\/parameters\/tournamentId"},{"$ref":"#\/components\/parameters\/stageId"},{"$ref":"#\/components\/parameters\/groupIds"},{"$ref":"#\/components\/parameters\/groupNumbers"}],"responses":{"206":{"description":"List of ranking items.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/RankingItem"}}}}}},"security":[{"apiKey":[]}]}},"\/stages\/{stage_id}\/ranking-items":{"get":{"deprecated":true,"tags":["viewer_rankings_items"],"summary":"Retrieve ranking items of a stage.","description":"Returns ranking items of a stage with a small summary of the associated participant in the ranking. The items are always ordered by ascending position.","parameters":[{"$ref":"#\/components\/parameters\/rankingItemRange"},{"$ref":"#\/components\/parameters\/stageId"},{"$ref":"#\/components\/parameters\/groupIds"},{"$ref":"#\/components\/parameters\/groupNumbers"}],"responses":{"206":{"description":"List of ranking items.","content":{"application\/json":{"schema":{"type":"array","items":{"$ref":"#\/components\/schemas\/RankingItem"}}}}}},"security":[{"apiKey":[]}]}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"parameters":{"rankingItemRange":{"name":"Range","in":"header","required":true,"schema":{"type":"string","example":"items=0-49"},"description":"A range of requested items using the \u0027items\u0027 unit. The size of the range can not exceed 50. (see [Pagination](https:\/\/developer.toornament.com\/v2\/overview\/pagination))"},"tournamentId":{"name":"tournament_id","in":"path","required":true,"schema":{"type":"string"},"description":"The id of the tournament you want to retrieve data about."},"stageId":{"name":"stage_id","in":"path","required":true,"schema":{"type":"string"},"description":"The id of the stage you want to retrieve data about."},"groupIds":{"name":"group_ids","in":"query","explode":false,"style":"form","schema":{"type":"array","items":{"type":"string"},"example":"618965314871946714,618932178746476544"},"description":"A list of group ids to filter."},"groupNumbers":{"name":"group_numbers","in":"query","explode":false,"style":"form","schema":{"type":"array","items":{"type":"integer"},"example":"3,4"},"description":"A list of group numbers to filter."}},"schemas":{"RankingItem":{"type":"object","required":["id","group_id","number","position","rank","participant","points","properties"],"properties":{"id":{"description":"The id of the ranking item.","type":"string","example":"618983668512789184"},"group_id":{"description":"The id of the group associated to this ranking.","type":"string","example":"618983668512789184"},"number":{"description":"A number used as relative identifier within the ranking. It is determined from the seed attributed to the participant during the placement.","type":"integer","example":2},"position":{"description":"A position used for presentation purposes. It is always unique within the same ranking.","type":"integer","example":4},"rank":{"description":"The ranking of the participant in the ranking. Multiple participants can share the same rank if they are tied after involving all configured tiebreakers.","type":"integer","nullable":true,"example":3},"participant":{"allOf":[{"$ref":"#\/components\/schemas\/Participant"},{"type":"object","nullable":true}]},"points":{"description":"A number of points acquired by the participant in the ranking.","type":"integer","example":17},"properties":{"description":"A list of ranking metrics (see ranking properties).","type":"object","oneOf":[{"$ref":"#\/components\/schemas\/RankingItemProperties"},{"$ref":"#\/components\/schemas\/RankingItemPropertiesWithScore"},{"$ref":"#\/components\/schemas\/RankingItemPropertiesSwiss"}],"example":{"wins":1,"draws":0,"losses":0,"played":1,"forfeits":0,"score_for":0,"score_against":0,"score_difference":0}}}},"Participant":{"type":"object","required":["id","name","custom_fields"],"properties":{"id":{"description":"The id of the participant.","type":"string","example":"375143143408309123"},"name":{"description":"The name of the participant.","type":"string","maxLength":40,"example":"Jon Snow"},"custom_fields":{"description":"The values of the public custom fields configured in the tournament using the machine names as keys. For more information, please read the [Custom Fields](https:\/\/developer.toornament.com\/v2\/core-concepts\/custom-fields) documentation.","type":"object"}}},"RankingItemProperties":{"type":"object","required":["wins","draws","losses","played","forfeits"],"properties":{"wins":{"type":"integer","example":1},"draws":{"type":"integer","example":2},"losses":{"type":"integer","example":3},"played":{"type":"integer","example":6},"forfeits":{"type":"integer","example":0}}},"RankingItemPropertiesWithScore":{"allOf":[{"$ref":"#\/components\/schemas\/RankingItemProperties"},{"type":"object","properties":{"score_for":{"type":"integer","example":1},"score_against":{"type":"integer","example":3},"score_difference":{"type":"integer","example":2}}}]},"RankingItemPropertiesSwiss":{"allOf":[{"$ref":"#\/components\/schemas\/RankingItemProperties"},{"type":"object","properties":{"match_history":{"type":"string","example":"WLFWW"}}}]}}}}