Skip to content

Get a competition

GET
/competitions/{competition_id}
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.

competition_id
required

A competition ID. Starts with cmp_.

string
/^cmp_[a-z0-9]{10}$/

The competition ID.

The competition.

Media typeapplication/json
object
id
required

A competition ID. Starts with cmp_.

string
/^cmp_[a-z0-9]{10}$/
name
required
string
type
required

league for a season-long round robin, tournament for a knockout event over a few days.

string
Allowed values: league tournament
organizer
required

The organizer. Only this organizer can submit results for the competition.

object
id
required

An organizer ID. Starts with org_.

string
/^org_[a-z0-9]{10}$/
name
required
string
season
required

A season, written as the year and a season name.

string
/^[0-9]{4}-(spring|summer|autumn|winter)$/
starts_on
required

The first day of the competition.

string format: date
ends_on
required

The last day of the competition.

string format: date
match_format
required

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_per_set
required

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.
integer
Allowed values: 4 6
no_ad
required

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.

boolean
final_set
required

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.
string
Allowed values: full_set match_tiebreak
venue_ids
required

Venues where the competition’s matches are played.

Array<string>

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"
]
}

The credentials are missing, invalid, or expired.

Media typeapplication/problem+json

An error, as RFC 9457 problem details.

object
type
required

A URL that identifies the error type and links to its documentation.

string format: uri
title
required

A short summary of the error type. It’s the same for every error of this type.

string
status
required

The HTTP status code.

integer
>= 400 <= 599
detail
required

An explanation of this occurrence of the error.

string
instance

The request path that caused the error.

string
errors

One item per invalid field or parameter. Only for invalid-request, invalid-score, and validation-failed.

Array<object>
object
pointer
required

A JSON Pointer to the invalid field in the request body, or #/ followed by the name of an invalid query parameter.

string
detail
required

What’s wrong with the field and how to fix it.

string

Examples

Exampleunauthenticated

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.

Media typeapplication/problem+json

An error, as RFC 9457 problem details.

object
type
required

A URL that identifies the error type and links to its documentation.

string format: uri
title
required

A short summary of the error type. It’s the same for every error of this type.

string
status
required

The HTTP status code.

integer
>= 400 <= 599
detail
required

An explanation of this occurrence of the error.

string
instance

The request path that caused the error.

string
errors

One item per invalid field or parameter. Only for invalid-request, invalid-score, and validation-failed.

Array<object>
object
pointer
required

A JSON Pointer to the invalid field in the request body, or #/ followed by the name of an invalid query parameter.

string
detail
required

What’s wrong with the field and how to fix it.

string

Examples

ExamplenotFound

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.

Media typeapplication/problem+json

An error, as RFC 9457 problem details.

object
type
required

A URL that identifies the error type and links to its documentation.

string format: uri
title
required

A short summary of the error type. It’s the same for every error of this type.

string
status
required

The HTTP status code.

integer
>= 400 <= 599
detail
required

An explanation of this occurrence of the error.

string
instance

The request path that caused the error.

string
errors

One item per invalid field or parameter. Only for invalid-request, invalid-score, and validation-failed.

Array<object>
object
pointer
required

A JSON Pointer to the invalid field in the request body, or #/ followed by the name of an invalid query parameter.

string
detail
required

What’s wrong with the field and how to fix it.

string

Examples

ExamplerateLimited

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"
}
Retry-After
integer
>= 1

Number of seconds to wait before you retry.

Example
30

© 2026 Saverio Cirillo · KRKplaysTennis is a fictional API · Built with Starlight