Get a competition
const url = 'https://api.krkplaystennis.example/v1/competitions/cmp_6tw2hn8rxe';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.krkplaystennis.example/v1/competitions/cmp_6tw2hn8rxe \ --header 'X-API-Key: <X-API-Key>'Returns a league or tournament, including its organizer and match format.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A competition ID. Starts with cmp_.
The competition ID.
Responses
Section titled “Responses”The competition.
object
A competition ID. Starts with cmp_.
league for a season-long round robin, tournament for a knockout event over a few days.
The organizer. Only this organizer can submit results for the competition.
object
An organizer ID. Starts with org_.
A season, written as the year and a season name.
The first day of the competition.
The last day of the competition.
The scoring rules for every match in the competition. All matches are best of three sets.
Each field is one rule, so new formats need new fields, not new enum values.
object
Games needed to win a set.
6: a set ends at 6 games with a 2-game lead or at 7-5. At 6-6, a tiebreak decides the set, which ends 7-6.4: short sets. A set ends at 4 games with a 2-game lead or at 5-3. At 4-4, a tiebreak decides the set, which ends 5-4.
true when a game at deuce is decided by a single point. The API records games, not points, so this rule doesn’t affect score validation or ratings.
How the match is decided at one set all:
full_set: a normal third set.match_tiebreak: a tiebreak to 10 points, with a 2-point lead, instead of a third set.
Venues where the competition’s matches are played.
Examples
League
{ "id": "cmp_6tw2hn8rxe", "name": "Kraków Autumn League 2026", "type": "league", "organizer": { "id": "org_4kd7ws2mzq", "name": "Kraków Amateur Tennis Association" }, "season": "2026-autumn", "starts_on": "2026-09-01", "ends_on": "2026-11-30", "match_format": { "games_per_set": 6, "no_ad": false, "final_set": "match_tiebreak" }, "venue_ids": [ "ven_7hk2p9wq4m", "ven_3xr8tn5cva" ]}Tournament
{ "id": "cmp_1qv7mz3kpd", "name": "Nowa Huta Indoor Open 2026", "type": "tournament", "organizer": { "id": "org_9tn3bx6rlp", "name": "Nowa Huta Indoor Tennis Hall" }, "season": "2026-winter", "starts_on": "2026-12-05", "ends_on": "2026-12-07", "match_format": { "games_per_set": 4, "no_ad": true, "final_set": "match_tiebreak" }, "venue_ids": [ "ven_3xr8tn5cva" ]}The credentials are missing, invalid, or expired.
An error, as RFC 9457 problem details.
object
A URL that identifies the error type and links to its documentation.
A short summary of the error type. It’s the same for every error of this type.
The HTTP status code.
An explanation of this occurrence of the error.
The request path that caused the error.
One item per invalid field or parameter. Only for invalid-request, invalid-score, and validation-failed.
object
A JSON Pointer to the invalid field in the request body, or #/ followed by the name of an invalid query parameter.
What’s wrong with the field and how to fix it.
Examples
Missing API key
{ "type": "https://saverio-cirillo.com/krk-plays-tennis-api/errors/#unauthenticated", "title": "Authentication required", "status": 401, "detail": "Send a valid API key in the X-API-Key header.", "instance": "/v1/players/plr_2b7xq9mhk4"}No resource exists with this ID.
An error, as RFC 9457 problem details.
object
A URL that identifies the error type and links to its documentation.
A short summary of the error type. It’s the same for every error of this type.
The HTTP status code.
An explanation of this occurrence of the error.
The request path that caused the error.
One item per invalid field or parameter. Only for invalid-request, invalid-score, and validation-failed.
object
A JSON Pointer to the invalid field in the request body, or #/ followed by the name of an invalid query parameter.
What’s wrong with the field and how to fix it.
Examples
Unknown player ID
{ "type": "https://saverio-cirillo.com/krk-plays-tennis-api/errors/#not-found", "title": "Not found", "status": 404, "detail": "No player exists with the ID plr_0000000000.", "instance": "/v1/players/plr_0000000000"}You sent too many requests. Wait for the number of seconds in Retry-After, then retry.
An error, as RFC 9457 problem details.
object
A URL that identifies the error type and links to its documentation.
A short summary of the error type. It’s the same for every error of this type.
The HTTP status code.
An explanation of this occurrence of the error.
The request path that caused the error.
One item per invalid field or parameter. Only for invalid-request, invalid-score, and validation-failed.
object
A JSON Pointer to the invalid field in the request body, or #/ followed by the name of an invalid query parameter.
What’s wrong with the field and how to fix it.
Examples
Rate limit reached
{ "type": "https://saverio-cirillo.com/krk-plays-tennis-api/errors/#rate-limited", "title": "Rate limit reached", "status": 429, "detail": "This API key is limited to 60 requests per minute. Retry after 30 seconds.", "instance": "/v1/matches"}Headers
Section titled “Headers”Number of seconds to wait before you retry.
Example
30© 2026 Saverio Cirillo · KRKplaysTennis is a fictional API · Built with Starlight