Skip to content

Tennis

ATP and WTA rankings, draws, Grand Slam finals and set-by-set results

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/tennis/index.md to help me query Tennis with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

The top ten of each tour.

Example output Β· captured
Connector release
v0.3.1
Engine
2.0.1
VGI protocol
3.4.0
SELECT tour, ranking, player_name, country, points
FROM tennis.main.current_rankings
WHERE ranking <= 10
ORDER BY tour, ranking
Result Β· first 5 rows
tour ranking player_name country points
ATP 1 Alexander Zverev GER 10,350
ATP 2 Jannik Sinner ITA 7950
ATP 3 Carlos Alcaraz ESP 7600
ATP 4 Ben Shelton USA 5570
ATP 5 Daniil Medvedev RUS 4220

Quick start

Choose where to run Tennis, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'tennis' AS tennis (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-tennis'
);

3. Run a query

query.sql
SELECT tour, ranking, player_name, country, points
FROM tennis.main.current_rankings
WHERE ranking <= 10
ORDER BY tour, ranking
More example queries β†’
Technical details
Verified connector release
v0.3.1
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'tennis' AS tennis (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-tennis'
);

Overview

Read-only ATP and WTA tennis rankings, tournaments and match results

Catalog

Everything tennis exposes once attached β€” read straight from the worker's released build.

tennis 1 schema
main 2 tables Β· 9 functions

ATP and WTA rankings, tournaments, matches and players

Schema examples (6)
Examples (6)

The top ten of each tour.

SELECT tour, ranking, player_name, country, points
FROM tennis.main.current_rankings
WHERE ranking <= 10
ORDER BY tour, ranking;
Result Β· first 5 rows
tour ranking player_name country points
ATP 1 Alexander Zverev GER 10,350
ATP 2 Jannik Sinner ITA 7950
ATP 3 Carlos Alcaraz ESP 7600
ATP 4 Ben Shelton USA 5570
ATP 5 Daniil Medvedev RUS 4220

Biggest climbers in the latest ATP release.

SELECT ranking, player_name, movement
FROM tennis.main.current_rankings
WHERE tour = 'ATP'
ORDER BY movement DESC
LIMIT 10;

This week's completed ATP singles matches won by the lower-ranked player, joining current_matches to current_rankings for both players (ATP ids are ESPN ids on both sides; players outside the top 150 drop out).

SELECT m.tournament_name, m.round, m.winner_name, w.ranking AS winner_rank,
  m.loser_name, l.ranking AS loser_rank, m.score
FROM tennis.main.current_matches AS m
JOIN tennis.main.current_rankings AS w ON w.tour = 'ATP' AND w.player_id = if(m.winner_side = 1, m.side1_player_id, m.side2_player_id)
JOIN tennis.main.current_rankings AS l ON l.tour = 'ATP' AND l.player_id = if(m.winner_side = 1, m.side2_player_id, m.side1_player_id)
WHERE m.tour = 'ATP' AND m.draw_type = 'singles' AND m.status = 'completed' AND w.ranking > l.ranking
ORDER BY w.ranking - l.ranking DESC, m.match_id;

Elena Rybakina's 2026 singles wins against players now in the WTA top 10, joining player_matches to current_rankings on the WTA opponent id.

SELECT p.opponent_name, r.ranking AS current_rank, count(*) AS wins
FROM tennis.main.player_matches('WTA', 324166, season := 2026) AS p
JOIN tennis.main.current_rankings AS r ON r.tour = 'WTA' AND r.player_id = p.opponent_id
WHERE p.draw_type = 'singles' AND p.result = 'W' AND r.ranking <= 10
GROUP BY ALL
ORDER BY current_rank;
2 more examples

Every 2026 tournament where Elena Rybakina lost a singles match: the round, who beat her, and the event's eventual singles champion from the WTA calendar.

SELECT p.tournament_name, p.round, p.opponent_name AS lost_to,
  t.singles_champion
FROM tennis.main.player_matches('WTA', 324166, season := 2026) AS p
JOIN tennis.main.tournaments('WTA', season := 2026) AS t ON t.tournament_id = p.tournament_id
WHERE p.draw_type = 'singles' AND p.result = 'L'
ORDER BY p.tournament_start_date;

Each 2026 Grand Slam singles champion with their current ranking and points, joining grand_slam_results to current_rankings by tour and player name (Slam finals carry no player ids).

SELECT g.tournament_name, g.draw, g.champion, r.ranking AS current_rank,
  r.points
FROM tennis.main.grand_slam_results(2026) AS g
LEFT JOIN tennis.main.current_rankings AS r ON r.tour = g.tour AND r.player_name = g.champion
WHERE g.draw IN ('Men''s Singles', 'Women''s Singles')
ORDER BY g.final_date, g.draw;
Tables
current_matches 3 examples35 cols

Every match of the ATP and WTA tournaments in play this week, one row per match

Columns
tour VARCHAR
ATP (men's draws), WTA (women's draws) or MIXED (mixed doubles).
source VARCHAR
Id space of the id columns: espn or wta.
season INTEGER
Season (calendar year).
tournament_id INTEGER
Tournament id in the source's id space; stable across seasons.
event_id VARCHAR
Tournament edition id, '<tournament_id>-<season>'.
tournament_name VARCHAR
Sponsor or official name of the tournament edition.
is_grand_slam BOOLEAN
Whether the tournament is a Grand Slam.
match_idnot null VARCHAR
Source match id.
draw VARCHAR
Draw, e.g. Men's Singles or Women's Doubles.
draw_type VARCHAR
singles or doubles.
qualifying BOOLEAN
Whether this is a qualifying-draw match.
round VARCHAR
Round name, e.g. Round 1, Quarterfinal, Final.
scheduled_at TIMESTAMP WITH TIME ZONE
Scheduled or actual start time (UTC).
status VARCHAR
scheduled, in_progress, completed, retired, walkover or other.
status_detail VARCHAR
Source status text.
court VARCHAR
Court name.
side1_player_id INTEGER
Id of the side 1 (first-listed) player, in the source's id space.
side1_player_name VARCHAR
Full name of the side 1 (first-listed) player.
side1_country VARCHAR
Three-letter country code of the side 1 player.
side1_partner_id INTEGER
Id of the side 1 doubles partner; NULL in singles.
side1_partner_name VARCHAR
Name of the side 1 doubles partner; NULL in singles.
side1_seed INTEGER
Tournament seeding of side 1 (1 = top seed); NULL if unseeded.
side2_player_id INTEGER
Id of the side 2 (second-listed) player, in the source's id space.
side2_player_name VARCHAR
Full name of the side 2 (second-listed) player.
side2_country VARCHAR
Three-letter country code of the side 2 player.
side2_partner_id INTEGER
Id of the side 2 doubles partner; NULL in singles.
side2_partner_name VARCHAR
Name of the side 2 doubles partner; NULL in singles.
side2_seed INTEGER
Tournament seeding of side 2 (1 = top seed); NULL if unseeded.
winner_side INTEGER
Winning side number (1 or 2, matching the side1_/side2_ columns); NULL until decided.
winner_name VARCHAR
Winning player or pair.
loser_name VARCHAR
Losing player or pair.
score VARCHAR
Score from the winner's view; tiebreak loser points in parentheses, match tiebreak as [10-8].
side1_sets_won INTEGER
Count of sets won by side 1.
side2_sets_won INTEGER
Count of sets won by side 2.
sets STRUCT of 4 fields[]
Per-set games for each side; UNNEST for set-level analysis.
STRUCT[] 4 fields
  • set_numberINTEGER
  • side1_gamesINTEGER
  • side2_gamesINTEGER
  • tiebreak_loser_pointsINTEGER
ConstraintsPRIMARY KEY (match_id)
Examples (3)

Completed singles results this week.

SELECT tournament_name, round, winner_name, loser_name, score
FROM tennis.main.current_matches
WHERE status = 'completed' AND draw_type = 'singles'
ORDER BY scheduled_at DESC;

Match count and completion by tournament and draw.

SELECT tournament_name, draw, count(*) AS matches,
  count(*) FILTER (WHERE status = 'completed') AS completed
FROM tennis.main.current_matches
GROUP BY ALL
ORDER BY tournament_name, draw;

This week's completed ATP singles matches won by the lower-ranked player, joining current_matches to current_rankings for both players (ATP ids are ESPN ids on both sides; players outside the top 150 drop out).

SELECT m.tournament_name, m.round, m.winner_name, w.ranking AS winner_rank,
  m.loser_name, l.ranking AS loser_rank, m.score
FROM tennis.main.current_matches AS m
JOIN tennis.main.current_rankings AS w ON w.tour = 'ATP' AND w.player_id = if(m.winner_side = 1, m.side1_player_id, m.side2_player_id)
JOIN tennis.main.current_rankings AS l ON l.tour = 'ATP' AND l.player_id = if(m.winner_side = 1, m.side2_player_id, m.side1_player_id)
WHERE m.tour = 'ATP' AND m.draw_type = 'singles' AND m.status = 'completed' AND w.ranking > l.ranking
ORDER BY w.ranking - l.ranking DESC, m.match_id;
Link
current_rankings 2 examples16 cols

Current ATP (top 150) and WTA (top 200) singles rankings, one row per player

Columns
tournot null VARCHAR
ATP or WTA.
ranking_type VARCHAR
singles or doubles.
source VARCHAR
Id space of player_id: wta (official WTA API) or espn.
ranked_at DATE
Date of the ranking release.
ranking INTEGER
Current ranking position (1 = best).
previous_ranking INTEGER
Position in the previous release.
movement INTEGER
Count of places gained since the previous release; negative means dropped.
points INTEGER
Ranking points (count) counting toward the ranking.
player_idnot null INTEGER
Player id in the source's id space.
player_name VARCHAR
Player full name.
first_name VARCHAR
Player first name.
last_name VARCHAR
Player last name.
country VARCHAR
Three-letter country code.
birth_date DATE
Date of birth (WTA source only).
age INTEGER
Age in years (ESPN source only).
tournaments_played INTEGER
Tournaments counted (WTA source only).
ConstraintsPRIMARY KEY (tour, player_id)
Examples (2)

The top ten of each tour.

SELECT tour, ranking, player_name, country, points
FROM tennis.main.current_rankings
WHERE ranking <= 10
ORDER BY tour, ranking;
Result Β· first 5 rows
tour ranking player_name country points
ATP 1 Alexander Zverev GER 10,350
ATP 2 Jannik Sinner ITA 7950
ATP 3 Carlos Alcaraz ESP 7600
ATP 4 Ben Shelton USA 5570
ATP 5 Daniil Medvedev RUS 4220

Biggest climbers in the latest ATP release.

SELECT ranking, player_name, movement
FROM tennis.main.current_rankings
WHERE tour = 'ATP'
ORDER BY movement DESC
LIMIT 10;
Link
Table functions
all_current_matches () 1 example

Every match of the ATP and WTA tournaments in play today (scan behind current_matches)

No arguments
Returns columns
tour VARCHAR
ATP (men's draws), WTA (women's draws) or MIXED (mixed doubles)
source VARCHAR
Id space of the id columns: espn or wta
season INTEGER
Season (calendar year)
tournament_id INTEGER
Tournament id in the source's id space; stable across seasons
event_id VARCHAR
Tournament edition id, '<tournament_id>-<season>'
tournament_name VARCHAR
Sponsor or official name of the tournament edition
is_grand_slam BOOLEAN
Whether the tournament is a Grand Slam
match_id VARCHAR
Source match id
draw VARCHAR
Draw, e.g. Men's Singles or Women's Doubles
draw_type VARCHAR
singles or doubles
qualifying BOOLEAN
Whether this is a qualifying-draw match
round VARCHAR
Round name, e.g. Round 1, Quarterfinal, Final
scheduled_at TIMESTAMP WITH TIME ZONE
Scheduled or actual start time (UTC)
status VARCHAR
scheduled, in_progress, completed, retired, walkover or other
status_detail VARCHAR
Source status text
court VARCHAR
Court name
side1_player_id INTEGER
Id of the side 1 (first-listed) player, in the source's id space
side1_player_name VARCHAR
Full name of the side 1 (first-listed) player
side1_country VARCHAR
Three-letter country code of the side 1 player
side1_partner_id INTEGER
Id of the side 1 doubles partner; NULL in singles
side1_partner_name VARCHAR
Name of the side 1 doubles partner; NULL in singles
side1_seed INTEGER
Tournament seeding of side 1 (1 = top seed); NULL if unseeded
side2_player_id INTEGER
Id of the side 2 (second-listed) player, in the source's id space
side2_player_name VARCHAR
Full name of the side 2 (second-listed) player
side2_country VARCHAR
Three-letter country code of the side 2 player
side2_partner_id INTEGER
Id of the side 2 doubles partner; NULL in singles
side2_partner_name VARCHAR
Name of the side 2 doubles partner; NULL in singles
side2_seed INTEGER
Tournament seeding of side 2 (1 = top seed); NULL if unseeded
winner_side INTEGER
Winning side number (1 or 2, matching the side1_/side2_ columns); NULL until decided
winner_name VARCHAR
Winning player or pair
loser_name VARCHAR
Losing player or pair
score VARCHAR
Score from the winner's view; tiebreak loser points in parentheses, match tiebreak as [10-8]
side1_sets_won INTEGER
Count of sets won by side 1
side2_sets_won INTEGER
Count of sets won by side 2
sets STRUCT of 4 fields[]
Per-set games for each side; UNNEST for set-level analysis
STRUCT[] 4 fields
  • set_numberINTEGER
  • side1_gamesINTEGER
  • side2_gamesINTEGER
  • tiebreak_loser_pointsINTEGER
Example

Latest completed matches from the backing scan.

SELECT tour, tournament_name, draw, round, winner_name, loser_name, score
FROM tennis.main.all_current_matches()
WHERE status = 'completed'
ORDER BY scheduled_at DESC
LIMIT 20;
Link
all_current_rankings () 1 example

Current ATP and WTA singles rankings (scan behind current_rankings)

No arguments
Returns columns
tour VARCHAR
ATP or WTA
ranking_type VARCHAR
singles or doubles
source VARCHAR
Id space of player_id: wta (official WTA API) or espn
ranked_at DATE
Date of the ranking release
ranking INTEGER
Current ranking position (1 = best)
previous_ranking INTEGER
Position in the previous release
movement INTEGER
Count of places gained since the previous release; negative means dropped
points INTEGER
Ranking points (count) counting toward the ranking
player_id INTEGER
Player id in the source's id space
player_name VARCHAR
Player full name
first_name VARCHAR
Player first name
last_name VARCHAR
Player last name
country VARCHAR
Three-letter country code
birth_date DATE
Date of birth (WTA source only)
age INTEGER
Age in years (ESPN source only)
tournaments_played INTEGER
Tournaments counted (WTA source only)
Example

Read the top three of each tour from the backing scan.

SELECT tour, ranking, player_name, country, points
FROM tennis.main.all_current_rankings()
WHERE ranking <= 3
ORDER BY tour, ranking;
Link
grand_slam_results (season INTEGER, tour := VARCHAR) 2 examples

Champions, runners-up and scores of every Grand Slam final in a season

Positional arguments
season INTEGER
Season (calendar year).
Named arguments
tour := VARCHAR
'ATP' for men's draws, 'WTA' for women's draws, or 'ALL' (adds mixed doubles). Β· default "ALL"
Returns columns
season INTEGER
Season (calendar year)
tournament_id INTEGER
ESPN tournament id
tournament_name VARCHAR
Australian Open, Roland Garros, Wimbledon or US Open
tour VARCHAR
ATP (men's), WTA (women's) or MIXED
draw VARCHAR
Draw, e.g. Men's Singles
final_date DATE
Date of the final (UTC)
champion VARCHAR
Winning player or pair
champion_country VARCHAR
Champion country code (first player for pairs)
champion_seed INTEGER
Champion seed
runner_up VARCHAR
Losing finalist or pair
runner_up_country VARCHAR
Runner-up country code
runner_up_seed INTEGER
Runner-up seed
score VARCHAR
Final score from the champion's view
status VARCHAR
completed, retired, walkover, in_progress or scheduled
Examples (2)

The 2026 men's Grand Slam finals.

SELECT tournament_name, draw, champion, runner_up, score
FROM tennis.main.grand_slam_results(2026, tour := 'ATP')
ORDER BY final_date, draw;

Each 2026 Grand Slam singles champion with their current ranking and points, joining grand_slam_results to current_rankings by tour and player name (Slam finals carry no player ids).

SELECT g.tournament_name, g.draw, g.champion, r.ranking AS current_rank,
  r.points
FROM tennis.main.grand_slam_results(2026) AS g
LEFT JOIN tennis.main.current_rankings AS r ON r.tour = g.tour AND r.player_name = g.champion
WHERE g.draw IN ('Men''s Singles', 'Women''s Singles')
ORDER BY g.final_date, g.draw;
Link
matches_on (tour VARCHAR, match_date DATE) 1 example

ATP and WTA matches scheduled on one day, with set scores

Arguments
tour VARCHAR
'ATP', 'WTA', or 'ALL' (adds mixed).
match_date DATE
Day whose matches to return (UTC).
Returns columns
tour VARCHAR
ATP (men's draws), WTA (women's draws) or MIXED (mixed doubles)
source VARCHAR
Id space of the id columns: espn or wta
season INTEGER
Season (calendar year)
tournament_id INTEGER
Tournament id in the source's id space; stable across seasons
event_id VARCHAR
Tournament edition id, '<tournament_id>-<season>'
tournament_name VARCHAR
Sponsor or official name of the tournament edition
is_grand_slam BOOLEAN
Whether the tournament is a Grand Slam
match_id VARCHAR
Source match id
draw VARCHAR
Draw, e.g. Men's Singles or Women's Doubles
draw_type VARCHAR
singles or doubles
qualifying BOOLEAN
Whether this is a qualifying-draw match
round VARCHAR
Round name, e.g. Round 1, Quarterfinal, Final
scheduled_at TIMESTAMP WITH TIME ZONE
Scheduled or actual start time (UTC)
status VARCHAR
scheduled, in_progress, completed, retired, walkover or other
status_detail VARCHAR
Source status text
court VARCHAR
Court name
side1_player_id INTEGER
Id of the side 1 (first-listed) player, in the source's id space
side1_player_name VARCHAR
Full name of the side 1 (first-listed) player
side1_country VARCHAR
Three-letter country code of the side 1 player
side1_partner_id INTEGER
Id of the side 1 doubles partner; NULL in singles
side1_partner_name VARCHAR
Name of the side 1 doubles partner; NULL in singles
side1_seed INTEGER
Tournament seeding of side 1 (1 = top seed); NULL if unseeded
side2_player_id INTEGER
Id of the side 2 (second-listed) player, in the source's id space
side2_player_name VARCHAR
Full name of the side 2 (second-listed) player
side2_country VARCHAR
Three-letter country code of the side 2 player
side2_partner_id INTEGER
Id of the side 2 doubles partner; NULL in singles
side2_partner_name VARCHAR
Name of the side 2 doubles partner; NULL in singles
side2_seed INTEGER
Tournament seeding of side 2 (1 = top seed); NULL if unseeded
winner_side INTEGER
Winning side number (1 or 2, matching the side1_/side2_ columns); NULL until decided
winner_name VARCHAR
Winning player or pair
loser_name VARCHAR
Losing player or pair
score VARCHAR
Score from the winner's view; tiebreak loser points in parentheses, match tiebreak as [10-8]
side1_sets_won INTEGER
Count of sets won by side 1
side2_sets_won INTEGER
Count of sets won by side 2
sets STRUCT of 4 fields[]
Per-set games for each side; UNNEST for set-level analysis
STRUCT[] 4 fields
  • set_numberINTEGER
  • side1_gamesINTEGER
  • side2_gamesINTEGER
  • tiebreak_loser_pointsINTEGER
Example

Matches on Wimbledon 2026 men's final day.

SELECT draw, round, winner_name, loser_name, score
FROM tennis.main.matches_on('ATP', DATE '2026-07-12')
ORDER BY scheduled_at;
Link
player (tour VARCHAR, player_id INTEGER, source := VARCHAR) 1 example

Profile of one ATP or WTA player

Positional arguments
tour VARCHAR
Tour: 'ATP' or 'WTA'.
player_id INTEGER
Player id in the source's id space.
Named arguments
source := VARCHAR
Id space: 'wta' (official WTA API, WTA default) or 'espn' (the only ATP source). Β· default null
Returns columns
tour VARCHAR
ATP or WTA
source VARCHAR
Id space of player_id: wta or espn
player_id INTEGER
Player id in the source's id space
player_name VARCHAR
Full name
first_name VARCHAR
First name
last_name VARCHAR
Last name
country VARCHAR
Three-letter country code (WTA source only)
birth_date DATE
Date of birth
age INTEGER
Age in years (ESPN source only)
height_inches INTEGER
Height in inches (ESPN source only)
weight_lbs INTEGER
Weight in pounds (ESPN source only)
plays VARCHAR
Playing hand, Right or Left (ESPN source only)
debut_year INTEGER
First professional season (ESPN source only)
active BOOLEAN
Whether the player is active (ESPN source only)
Example

Carlos Alcaraz's ESPN profile.

SELECT player_name, birth_date, height_inches, plays, debut_year
FROM tennis.main.player('ATP', 3782);
Link
player_matches (tour VARCHAR, player_id INTEGER, season := INTEGER, source := VARCHAR) 3 examples

One ATP or WTA player's match results for a season

Positional arguments
tour VARCHAR
Tour: 'ATP' or 'WTA'.
player_id INTEGER
Player id in the source's id space.
Named arguments
season := INTEGER
Season (calendar year); NULL means the current year. Β· default null
source := VARCHAR
Id space: 'wta' (official WTA API, WTA default) or 'espn' (the only ATP source). Β· default null
Returns columns
tour VARCHAR
ATP or WTA
source VARCHAR
Id space of the id columns: wta or espn
season INTEGER
Season (calendar year)
player_id INTEGER
The requested player's id
tournament_id INTEGER
Source tournament id
tournament_name VARCHAR
Tournament name
tournament_level VARCHAR
Tournament tier, e.g. Grand Slam or WTA 500
surface VARCHAR
Court surface (WTA source only)
tournament_start_date DATE
Tournament start date
match_id VARCHAR
Source match id (ESPN source only)
scheduled_at TIMESTAMP WITH TIME ZONE
Match start time (ESPN source only)
draw_type VARCHAR
singles or doubles
qualifying BOOLEAN
Whether this is a qualifying-draw match
round VARCHAR
Round name
partner_id INTEGER
Doubles partner id
partner_name VARCHAR
Doubles partner name
opponent_id INTEGER
Opponent id
opponent_name VARCHAR
Opponent name
opponent_country VARCHAR
Opponent country code
opponent_partner_name VARCHAR
Opponent's doubles partner
player_seed INTEGER
The player's seed
opponent_seed INTEGER
Opponent seed
player_rank INTEGER
The player's ranking at entry (WTA source only)
opponent_rank INTEGER
Opponent ranking at entry (WTA source only)
result VARCHAR
W or L for the player; NULL if undecided
score VARCHAR
Score from the winner's view
status VARCHAR
completed, retired, walkover, in_progress or scheduled
ranking_points INTEGER
Ranking points earned at the tournament (WTA source only)
prize_money_won BIGINT
Prize money earned at the tournament (WTA source only)
Examples (3)

Elena Rybakina's 2026 singles results.

SELECT tournament_name, round, opponent_name, result, score
FROM tennis.main.player_matches('WTA', 324166, season := 2026)
WHERE draw_type = 'singles';

Every 2026 tournament where Elena Rybakina lost a singles match: the round, who beat her, and the event's eventual singles champion from the WTA calendar.

SELECT p.tournament_name, p.round, p.opponent_name AS lost_to,
  t.singles_champion
FROM tennis.main.player_matches('WTA', 324166, season := 2026) AS p
JOIN tennis.main.tournaments('WTA', season := 2026) AS t ON t.tournament_id = p.tournament_id
WHERE p.draw_type = 'singles' AND p.result = 'L'
ORDER BY p.tournament_start_date;

Elena Rybakina's 2026 singles wins against players now in the WTA top 10, joining player_matches to current_rankings on the WTA opponent id.

SELECT p.opponent_name, r.ranking AS current_rank, count(*) AS wins
FROM tennis.main.player_matches('WTA', 324166, season := 2026) AS p
JOIN tennis.main.current_rankings AS r ON r.tour = 'WTA' AND r.player_id = p.opponent_id
WHERE p.draw_type = 'singles' AND p.result = 'W' AND r.ranking <= 10
GROUP BY ALL
ORDER BY current_rank;
Link
rankings (tour VARCHAR, max_rank := INTEGER, ranking_type := VARCHAR) 1 example

Current ATP or WTA singles or doubles ranking

Positional arguments
tour VARCHAR
Tour: 'ATP' or 'WTA'.
Named arguments
max_rank := INTEGER
Deepest ranking position to return (ATP stops at 150). Β· default 200
ranking_type := VARCHAR
singles or doubles; ATP doubles are not published by the ATP source. Β· default "singles"
Returns columns
tour VARCHAR
ATP or WTA
ranking_type VARCHAR
singles or doubles
source VARCHAR
Id space of player_id: wta (official WTA API) or espn
ranked_at DATE
Date of the ranking release
ranking INTEGER
Current ranking position (1 = best)
previous_ranking INTEGER
Position in the previous release
movement INTEGER
Count of places gained since the previous release; negative means dropped
points INTEGER
Ranking points (count) counting toward the ranking
player_id INTEGER
Player id in the source's id space
player_name VARCHAR
Player full name
first_name VARCHAR
Player first name
last_name VARCHAR
Player last name
country VARCHAR
Three-letter country code
birth_date DATE
Date of birth (WTA source only)
age INTEGER
Age in years (ESPN source only)
tournaments_played INTEGER
Tournaments counted (WTA source only)
Example

The WTA doubles top 20.

SELECT ranking, player_name, country, points, movement
FROM tennis.main.rankings('WTA', ranking_type := 'doubles', max_rank := 20)
ORDER BY ranking;
Link
tournament_matches (tour VARCHAR, tournament_id INTEGER, season INTEGER, source := VARCHAR) 1 example

Every singles and doubles match of one ATP or WTA tournament edition

Positional arguments
tour VARCHAR
Tour: 'ATP' or 'WTA'.
tournament_id INTEGER
Tournament id from tournaments(), e.g. WTA 901, ESPN 188.
season INTEGER
Season (calendar year).
Named arguments
source := VARCHAR
Id space: 'wta' (official WTA API, WTA default) or 'espn' (the only ATP source). Β· default null
Returns columns
tour VARCHAR
ATP (men's draws), WTA (women's draws) or MIXED (mixed doubles)
source VARCHAR
Id space of the id columns: espn or wta
season INTEGER
Season (calendar year)
tournament_id INTEGER
Tournament id in the source's id space; stable across seasons
event_id VARCHAR
Tournament edition id, '<tournament_id>-<season>'
tournament_name VARCHAR
Sponsor or official name of the tournament edition
is_grand_slam BOOLEAN
Whether the tournament is a Grand Slam
match_id VARCHAR
Source match id
draw VARCHAR
Draw, e.g. Men's Singles or Women's Doubles
draw_type VARCHAR
singles or doubles
qualifying BOOLEAN
Whether this is a qualifying-draw match
round VARCHAR
Round name, e.g. Round 1, Quarterfinal, Final
scheduled_at TIMESTAMP WITH TIME ZONE
Scheduled or actual start time (UTC)
status VARCHAR
scheduled, in_progress, completed, retired, walkover or other
status_detail VARCHAR
Source status text
court VARCHAR
Court name
side1_player_id INTEGER
Id of the side 1 (first-listed) player, in the source's id space
side1_player_name VARCHAR
Full name of the side 1 (first-listed) player
side1_country VARCHAR
Three-letter country code of the side 1 player
side1_partner_id INTEGER
Id of the side 1 doubles partner; NULL in singles
side1_partner_name VARCHAR
Name of the side 1 doubles partner; NULL in singles
side1_seed INTEGER
Tournament seeding of side 1 (1 = top seed); NULL if unseeded
side2_player_id INTEGER
Id of the side 2 (second-listed) player, in the source's id space
side2_player_name VARCHAR
Full name of the side 2 (second-listed) player
side2_country VARCHAR
Three-letter country code of the side 2 player
side2_partner_id INTEGER
Id of the side 2 doubles partner; NULL in singles
side2_partner_name VARCHAR
Name of the side 2 doubles partner; NULL in singles
side2_seed INTEGER
Tournament seeding of side 2 (1 = top seed); NULL if unseeded
winner_side INTEGER
Winning side number (1 or 2, matching the side1_/side2_ columns); NULL until decided
winner_name VARCHAR
Winning player or pair
loser_name VARCHAR
Losing player or pair
score VARCHAR
Score from the winner's view; tiebreak loser points in parentheses, match tiebreak as [10-8]
side1_sets_won INTEGER
Count of sets won by side 1
side2_sets_won INTEGER
Count of sets won by side 2
sets STRUCT of 4 fields[]
Per-set games for each side; UNNEST for set-level analysis
STRUCT[] 4 fields
  • set_numberINTEGER
  • side1_gamesINTEGER
  • side2_gamesINTEGER
  • tiebreak_loser_pointsINTEGER
Example

Australian Open 2026 women's singles semifinals and final.

SELECT round, winner_name, loser_name, score
FROM tennis.main.tournament_matches('WTA', 901, 2026)
WHERE draw_type = 'singles' AND NOT qualifying AND round IN ('Semifinal', 'Final');
Link
tournaments (tour VARCHAR, season := INTEGER, source := VARCHAR) 1 example

ATP or WTA tournament calendar for a season, with champions

Positional arguments
tour VARCHAR
Tour: 'ATP' or 'WTA'.
Named arguments
season := INTEGER
Season (calendar year); NULL means the current year. Β· default null
source := VARCHAR
Id space: 'wta' (official WTA API, WTA default) or 'espn' (the only ATP source). Β· default null
Returns columns
tour VARCHAR
ATP or WTA
source VARCHAR
Id space of the id columns: wta or espn
season INTEGER
Season (calendar year)
tournament_id INTEGER
Source tournament id; pass to tournament_matches()
event_id VARCHAR
Tournament edition id, '<tournament_id>-<season>'
name VARCHAR
Tournament name
level VARCHAR
Tier, e.g. Grand Slam, WTA 1000 (ESPN gives Grand Slam only)
is_grand_slam BOOLEAN
Whether the tournament is a Grand Slam
surface VARCHAR
Court surface (WTA source only)
indoor_outdoor VARCHAR
I for indoor or O for outdoor (WTA source only)
city VARCHAR
Host city
country VARCHAR
Host country
start_date DATE
First day
end_date DATE
Last day
singles_draw_size INTEGER
Singles main-draw size (WTA source only)
doubles_draw_size INTEGER
Doubles main-draw size (WTA source only)
prize_money BIGINT
Total prize money (WTA source only)
prize_money_currency VARCHAR
Prize-money currency
status VARCHAR
upcoming, in_progress or completed
singles_champion_id INTEGER
Singles champion player id
singles_champion VARCHAR
Singles champion name
doubles_champions VARCHAR
Doubles champion pair, 'A / B'
Example

2026 WTA Grand Slams and WTA 1000s with champions.

SELECT name, level, surface, start_date, singles_champion
FROM tennis.main.tournaments('WTA', season := 2026)
WHERE level IN ('Grand Slam', 'WTA 1000')
ORDER BY start_date;
Link

Try these queries

current_rankings_cover_both_tours β€” Singles rankings are present for both the ATP and WTA.

SELECT count(DISTINCT tour) AS tours FROM tennis.main.current_rankings;

Uses current_rankings

current_matches_are_typed β€” Every current match has an id and a known status.

SELECT coalesce(bool_and(match_id IS NOT NULL AND status IN ('scheduled','in_progress','completed','retired','walkover','other')), true) AS ok
FROM tennis.main.current_matches;

Uses current_matches

ao_2026_womens_champion β€” Elena Rybakina won the 2026 Australian Open women's singles final.

SELECT winner_name
FROM tennis.main.tournament_matches('WTA', 901, 2026)
WHERE draw_type = 'singles' AND round = 'Final';

Uses tournament_matches

Elena Rybakina's 2026 singles wins against players now in the WTA top 10, joining player_matches to current_rankings on the WTA opponent id.

SELECT p.opponent_name, r.ranking AS current_rank, count(*) AS wins
FROM tennis.main.player_matches('WTA', 324166, season := 2026) AS p
JOIN tennis.main.current_rankings AS r ON r.tour = 'WTA' AND r.player_id = p.opponent_id
WHERE p.draw_type = 'singles' AND p.result = 'W' AND r.ranking <= 10
GROUP BY ALL
ORDER BY current_rank

Uses player_matchescurrent_rankings

Each 2026 Grand Slam singles champion with their current ranking and points, joining grand_slam_results to current_rankings by tour and player name (Slam finals carry no player ids).

SELECT g.tournament_name, g.draw, g.champion, r.ranking AS current_rank,
  r.points
FROM tennis.main.grand_slam_results(2026) AS g
LEFT JOIN tennis.main.current_rankings AS r ON r.tour = g.tour AND r.player_name = g.champion
WHERE g.draw IN ('Men''s Singles', 'Women''s Singles')
ORDER BY g.final_date, g.draw

Uses grand_slam_resultscurrent_rankings

Read the top three of each tour from the backing scan.

SELECT tour, ranking, player_name, country, points
FROM tennis.main.all_current_rankings()
WHERE ranking <= 3
ORDER BY tour, ranking

Uses all_current_rankings

1 more example

each_tour_has_a_number_one β€” Each tour has exactly one player ranked first.

SELECT bool_and(n = 1) AS ok
FROM (SELECT tour, count(*) AS n FROM tennis.main.current_rankings WHERE ranking = 1 GROUP BY tour);

Uses current_rankings

13 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Who is currently ranked world number one on the ATP and WTA?
  • Who tops the current WTA doubles ranking, and with how many points?
  • Who won the 2026 Wimbledon men's singles final, and what was the score?
  • Who won the 2026 Australian Open women's singles title and whom did she beat?
  • List the 2026 Grand Slam men's and women's singles champions.
  • List the 2026 WTA 1000 tournaments with their surfaces and singles champions.

Tennis is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.