Skip to content

Commit

Permalink
document /api/broadcast/top
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 8, 2024
1 parent dd56ccb commit 6a5a910
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 112 deletions.
3 changes: 3 additions & 0 deletions doc/specs/lichess-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ paths:
/api/broadcast:
$ref: './tags/broadcasts/api-broadcasts-official.yaml'

/api/broadcast/top:
$ref: './tags/broadcasts/api-broadcasts-top.yaml'

/api/broadcast/by/{username}:
$ref: './tags/broadcasts/api-broadcasts-by-user.yaml'

Expand Down
36 changes: 36 additions & 0 deletions doc/specs/schemas/BroadcastTop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
type: object

properties:
active:
type: array
items:
$ref: "./BroadcastWithLastRound.yaml"
upcoming:
type: array
items:
$ref: "./BroadcastWithLastRound.yaml"
past:
type: object
properties:
currentPage:
type: number
example: 4
maxPerPage:
type: number
example: 20
currentPageResults:
type: array
items:
$ref: "./BroadcastWithLastRound.yaml"
nbResults:
type: number
example: 205194
previousPage:
type: [number, "null"]
example: 3
nextPage:
type: [number, "null"]
example: 5
nbPages:
type: number
example: 13680
9 changes: 9 additions & 0 deletions doc/specs/schemas/BroadcastWithLastRound.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object

properties:
group:
type: string
tour:
$ref: "./BroadcastTour.yaml"
lastRound:
$ref: "./BroadcastRoundInfo.yaml"
224 changes: 112 additions & 112 deletions doc/specs/tags/broadcasts/api-broadcasts-official.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ get:
default: 20
minimum: 1
responses:
'200':
"200":
description: The list of official broadcasts.
headers:
Access-Control-Allow-Origin:
Expand All @@ -27,115 +27,115 @@ get:
content:
application/x-ndjson:
schema:
$ref: '../../schemas/BroadcastWithRounds.yaml'
$ref: "../../schemas/BroadcastWithRounds.yaml"
example:
{
'tour':
{
'id': 'qkY2yAcs',
'name': 'Norway Chess 2024 | Open',
'slug': 'norway-chess-2024--open',
'description': 'May 27th - June 7th | 6-player double round-robin | Classical time control | Carlsen, Ding, Caruana, Nakamura',
'createdAt': 1716672627410,
'tier': 5,
'image': 'https://image.lichess1.org/display?h=400&op=thumbnail&path=aaarmstark:relay:qkY2yAcs:dCwnFf0q.jpg&w=800&sig=36d5da931b2f9631e3ad4ae67cdb6b6412c469bb',
'markup': "<p>The <strong>Norway Chess 2024</strong> is a 6-player double round-robin tournament, held from the 27th of May to the 7th of June in Stavanger, Norway, featuring the former and current World Champions <a href=\"https://lichess.org/fide/1503014/Carlsen_Magnus\">Magnus Carlsen</a> and <a href=\"https://lichess.org/fide/8603677/Ding_Liren\">Ding Liren</a>, <a href=\"https://lichess.org/fide/2020009/Caruana_Fabiano\">Fabiano Caruana</a>, <a href=\"https://lichess.org/fide/2016192/Nakamura_Hikaru\">Hikaru Nakamura</a>, <a href=\"https://lichess.org/fide/25059530/Praggnanandhaa_R\">R Praggnanandhaa</a> and <a href=\"https://lichess.org/fide/12573981/Firouzja_Alireza\">Alireza Firouzja</a>.</p>\n<p>Time control is 120 minutes for the entire game with a 10-second increment from move 41.</p>\n<p><a href=\"https://norwaychess.no/en/\" rel=\"nofollow noopener noreferrer\">Official Website</a> | <a href=\"https://stats.norwaychess.no/2024/standings\" rel=\"nofollow noopener noreferrer\">Standings</a> | <a href=\"https://norwaychess.no/en/regulations-3/\" rel=\"nofollow noopener noreferrer\">Regulations</a></p>\n<hr />\n<p>Mutually agreed draws are not allowed until both players have made at least 30 moves.</p>\n<p>In the event of a draw, an Armageddon game is played to determine the winner of the round. Players keep the colour from the classical game. Time control is 10 minutes for White and 7 minutes for Black with a 1-second increment from move 41.</p>\n<hr />\n<h3>Standings after Round 5</h3>\n<p>Players are awarded:</p>\n<ul>\n<li><strong>3</strong> points for <strong>winning</strong> a <strong>classical</strong> game (<strong>W</strong>)</li>\n<li><strong>1</strong> point for <strong>drawing</strong> a <strong>classical</strong> game (<strong>D</strong>)</li>\n<li><strong>0.5</strong> points for <strong>winning</strong> the <strong>Armageddon</strong> game (<strong>Aw</strong>)</li>\n<li><strong>0</strong> points for <strong>losing</strong> a <strong>classical</strong> game (<strong>L</strong>)</li>\n</ul>\n<div class=\"slist-wrapper\">\n<table class=\"slist\">\n<thead>\n<tr><th>Rank</th><th>Player</th><th>Elo</th><th>W</th><th>D</th><th>L</th><th>Aw</th><th>Total</th></tr>\n</thead>\n<tbody>\n<tr><td>1</td><td>GM <a href=\"https://lichess.org/fide/2016192/Nakamura_Hikaru\">Nakamura</a></td><td>2794</td><td>2</td><td>3</td><td>0</td><td>2</td><td>10.0</td></tr>\n<tr><td>2</td><td>GM <a href=\"https://lichess.org/fide/1503014/Carlsen_Magnus\">Carlsen</a></td><td>2830</td><td>2</td><td>2</td><td>1</td><td>2</td><td>9.0</td></tr>\n<tr><td>3</td><td>GM <a href=\"https://lichess.org/fide/25059530/Praggnanandhaa_R\">Praggnanandhaa</a></td><td>2747</td><td>2</td><td>2</td><td>1</td><td>1</td><td>8.5</td></tr>\n<tr><td>4</td><td>GM <a href=\"https://lichess.org/fide/12573981/Firouzja_Alireza\">Firouzja</a></td><td>2737</td><td>1</td><td>3</td><td>1</td><td>1</td><td>6.5</td></tr>\n<tr><td>5</td><td>GM <a href=\"https://lichess.org/fide/2020009/Caruana_Fabiano\">Caruana</a></td><td>2805</td><td>1</td><td>2</td><td>2</td><td>0</td><td>5.0</td></tr>\n<tr><td>6</td><td>GM <a href=\"https://lichess.org/fide/8603677/Ding_Liren\">Ding</a></td><td>2762</td><td>0</td><td>2</td><td>3</td><td>1</td><td>2.5</td></tr>\n</tbody>\n</table>\n</div>\n<hr />\n<p>Previous editions: <a href=\"https://lichess.org/broadcast/norway-chess-2023/eHDUE77y\" rel=\"nofollow noopener noreferrer\">2023</a> | <a href=\"https://lichess.org/broadcast/2022-norway-chess/KeMXJB4g\" rel=\"nofollow noopener noreferrer\">2022</a> | <a href=\"https://lichess.org/broadcast/norway-chess-2021/qQvTLffB\" rel=\"nofollow noopener noreferrer\">2021</a></p>\n",
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/qkY2yAcs',
},
'rounds':
[
{
'id': 'VFMWFVLX',
'name': 'Round 5',
'slug': 'round-5',
'createdAt': 1716681349783,
'finished': true,
'startsAt': 1717254000000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-5/VFMWFVLX',
},
{
'id': '4JSenCaJ',
'name': 'Round 4',
'slug': 'round-4',
'createdAt': 1716681322100,
'finished': true,
'startsAt': 1717081200000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-4/4JSenCaJ',
},
{
'id': 'xmZcMs9U',
'name': 'Round 3',
'slug': 'round-3',
'createdAt': 1716681206009,
'finished': true,
'startsAt': 1716994800000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-3/xmZcMs9U',
},
{
'id': 'sbOHYOVj',
'name': 'Round 2',
'slug': 'round-2',
'createdAt': 1716673477425,
'finished': true,
'startsAt': 1716908400000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-2/sbOHYOVj',
},
{
'id': 'I9TLGEOt',
'name': 'Round 1',
'slug': 'round-1',
'createdAt': 1716672669495,
'finished': true,
'startsAt': 1716822000000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-1/I9TLGEOt',
},
{
'id': 'E0YSbWDC',
'name': 'Tiebreaks',
'slug': 'tiebreaks',
'createdAt': 1716681627336,
'startsAt': 1717790400000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/tiebreaks/E0YSbWDC',
},
{
'id': 'C5Zzd9mM',
'name': 'Round 10',
'slug': 'round-10',
'createdAt': 1716681541792,
'startsAt': 1717772400000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-10/C5Zzd9mM',
},
{
'id': 'Qvlkp2yF',
'name': 'Round 9',
'slug': 'round-9',
'createdAt': 1716681503527,
'startsAt': 1717686000000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-9/Qvlkp2yF',
},
{
'id': '2xhPECG3',
'name': 'Round 8',
'slug': 'round-8',
'createdAt': 1716681472192,
'startsAt': 1717513200000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-8/2xhPECG3',
},
{
'id': '4FLBpAW3',
'name': 'Round 7',
'slug': 'round-7',
'createdAt': 1716681411436,
'startsAt': 1717426800000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-7/4FLBpAW3',
},
{
'id': 'Whq5YPU7',
'name': 'Round 6',
'slug': 'round-6',
'createdAt': 1716681379848,
'startsAt': 1717340400000,
'url': 'https://lichess.org/broadcast/norway-chess-2024--open/round-6/Whq5YPU7',
},
],
}
{
"tour":
{
"id": "qkY2yAcs",
"name": "Norway Chess 2024 | Open",
"slug": "norway-chess-2024--open",
"description": "May 27th - June 7th | 6-player double round-robin | Classical time control | Carlsen, Ding, Caruana, Nakamura",
"createdAt": 1716672627410,
"tier": 5,
"image": "https://image.lichess1.org/display?h=400&op=thumbnail&path=aaarmstark:relay:qkY2yAcs:dCwnFf0q.jpg&w=800&sig=36d5da931b2f9631e3ad4ae67cdb6b6412c469bb",
"markup": "<p>The <strong>Norway Chess 2024</strong> is a 6-player double round-robin tournament, held from the 27th of May to the 7th of June in Stavanger, Norway, featuring the former and current World Champions <a href=\"https://lichess.org/fide/1503014/Carlsen_Magnus\">Magnus Carlsen</a> and <a href=\"https://lichess.org/fide/8603677/Ding_Liren\">Ding Liren</a>, <a href=\"https://lichess.org/fide/2020009/Caruana_Fabiano\">Fabiano Caruana</a>, <a href=\"https://lichess.org/fide/2016192/Nakamura_Hikaru\">Hikaru Nakamura</a>, <a href=\"https://lichess.org/fide/25059530/Praggnanandhaa_R\">R Praggnanandhaa</a> and <a href=\"https://lichess.org/fide/12573981/Firouzja_Alireza\">Alireza Firouzja</a>.</p>\n<p>Time control is 120 minutes for the entire game with a 10-second increment from move 41.</p>\n<p><a href=\"https://norwaychess.no/en/\" rel=\"nofollow noopener noreferrer\">Official Website</a> | <a href=\"https://stats.norwaychess.no/2024/standings\" rel=\"nofollow noopener noreferrer\">Standings</a> | <a href=\"https://norwaychess.no/en/regulations-3/\" rel=\"nofollow noopener noreferrer\">Regulations</a></p>\n<hr />\n<p>Mutually agreed draws are not allowed until both players have made at least 30 moves.</p>\n<p>In the event of a draw, an Armageddon game is played to determine the winner of the round. Players keep the colour from the classical game. Time control is 10 minutes for White and 7 minutes for Black with a 1-second increment from move 41.</p>\n<hr />\n<h3>Standings after Round 5</h3>\n<p>Players are awarded:</p>\n<ul>\n<li><strong>3</strong> points for <strong>winning</strong> a <strong>classical</strong> game (<strong>W</strong>)</li>\n<li><strong>1</strong> point for <strong>drawing</strong> a <strong>classical</strong> game (<strong>D</strong>)</li>\n<li><strong>0.5</strong> points for <strong>winning</strong> the <strong>Armageddon</strong> game (<strong>Aw</strong>)</li>\n<li><strong>0</strong> points for <strong>losing</strong> a <strong>classical</strong> game (<strong>L</strong>)</li>\n</ul>\n<div class=\"slist-wrapper\">\n<table class=\"slist\">\n<thead>\n<tr><th>Rank</th><th>Player</th><th>Elo</th><th>W</th><th>D</th><th>L</th><th>Aw</th><th>Total</th></tr>\n</thead>\n<tbody>\n<tr><td>1</td><td>GM <a href=\"https://lichess.org/fide/2016192/Nakamura_Hikaru\">Nakamura</a></td><td>2794</td><td>2</td><td>3</td><td>0</td><td>2</td><td>10.0</td></tr>\n<tr><td>2</td><td>GM <a href=\"https://lichess.org/fide/1503014/Carlsen_Magnus\">Carlsen</a></td><td>2830</td><td>2</td><td>2</td><td>1</td><td>2</td><td>9.0</td></tr>\n<tr><td>3</td><td>GM <a href=\"https://lichess.org/fide/25059530/Praggnanandhaa_R\">Praggnanandhaa</a></td><td>2747</td><td>2</td><td>2</td><td>1</td><td>1</td><td>8.5</td></tr>\n<tr><td>4</td><td>GM <a href=\"https://lichess.org/fide/12573981/Firouzja_Alireza\">Firouzja</a></td><td>2737</td><td>1</td><td>3</td><td>1</td><td>1</td><td>6.5</td></tr>\n<tr><td>5</td><td>GM <a href=\"https://lichess.org/fide/2020009/Caruana_Fabiano\">Caruana</a></td><td>2805</td><td>1</td><td>2</td><td>2</td><td>0</td><td>5.0</td></tr>\n<tr><td>6</td><td>GM <a href=\"https://lichess.org/fide/8603677/Ding_Liren\">Ding</a></td><td>2762</td><td>0</td><td>2</td><td>3</td><td>1</td><td>2.5</td></tr>\n</tbody>\n</table>\n</div>\n<hr />\n<p>Previous editions: <a href=\"https://lichess.org/broadcast/norway-chess-2023/eHDUE77y\" rel=\"nofollow noopener noreferrer\">2023</a> | <a href=\"https://lichess.org/broadcast/2022-norway-chess/KeMXJB4g\" rel=\"nofollow noopener noreferrer\">2022</a> | <a href=\"https://lichess.org/broadcast/norway-chess-2021/qQvTLffB\" rel=\"nofollow noopener noreferrer\">2021</a></p>\n",
"url": "https://lichess.org/broadcast/norway-chess-2024--open/qkY2yAcs",
},
"rounds":
[
{
"id": "VFMWFVLX",
"name": "Round 5",
"slug": "round-5",
"createdAt": 1716681349783,
"finished": true,
"startsAt": 1717254000000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-5/VFMWFVLX",
},
{
"id": "4JSenCaJ",
"name": "Round 4",
"slug": "round-4",
"createdAt": 1716681322100,
"finished": true,
"startsAt": 1717081200000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-4/4JSenCaJ",
},
{
"id": "xmZcMs9U",
"name": "Round 3",
"slug": "round-3",
"createdAt": 1716681206009,
"finished": true,
"startsAt": 1716994800000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-3/xmZcMs9U",
},
{
"id": "sbOHYOVj",
"name": "Round 2",
"slug": "round-2",
"createdAt": 1716673477425,
"finished": true,
"startsAt": 1716908400000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-2/sbOHYOVj",
},
{
"id": "I9TLGEOt",
"name": "Round 1",
"slug": "round-1",
"createdAt": 1716672669495,
"finished": true,
"startsAt": 1716822000000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-1/I9TLGEOt",
},
{
"id": "E0YSbWDC",
"name": "Tiebreaks",
"slug": "tiebreaks",
"createdAt": 1716681627336,
"startsAt": 1717790400000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/tiebreaks/E0YSbWDC",
},
{
"id": "C5Zzd9mM",
"name": "Round 10",
"slug": "round-10",
"createdAt": 1716681541792,
"startsAt": 1717772400000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-10/C5Zzd9mM",
},
{
"id": "Qvlkp2yF",
"name": "Round 9",
"slug": "round-9",
"createdAt": 1716681503527,
"startsAt": 1717686000000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-9/Qvlkp2yF",
},
{
"id": "2xhPECG3",
"name": "Round 8",
"slug": "round-8",
"createdAt": 1716681472192,
"startsAt": 1717513200000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-8/2xhPECG3",
},
{
"id": "4FLBpAW3",
"name": "Round 7",
"slug": "round-7",
"createdAt": 1716681411436,
"startsAt": 1717426800000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-7/4FLBpAW3",
},
{
"id": "Whq5YPU7",
"name": "Round 6",
"slug": "round-6",
"createdAt": 1716681379848,
"startsAt": 1717340400000,
"url": "https://lichess.org/broadcast/norway-chess-2024--open/round-6/Whq5YPU7",
},
],
}
Loading

0 comments on commit 6a5a910

Please sign in to comment.