Tennis
ATP and WTA rankings, draws, Grand Slam finals and set-by-set results
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available Β· $10/month organization minimum
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
| 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.
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;
INSTALL vgi FROM community;
LOAD vgi;
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
SELECT tour, ranking, player_name, country, points
FROM tennis.main.current_rankings
WHERE ranking <= 10
ORDER BY tour, ranking
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connectorβs deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
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;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'tennis' AS tennis
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT tour, ranking, player_name, country, points
FROM tennis.main.current_rankings
WHERE ranking <= 10
ORDER BY tour, ranking
Query Farm operates Tennis for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
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;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use tennis as the catalog alias for the query below.
4. Run a query
SELECT tour, ranking, player_name, country, points
FROM tennis.main.current_rankings
WHERE ranking <= 10
ORDER BY tour, ranking
Technical details
- Verified connector release
- v0.3.1
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
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
Rankings, tournament calendars, full draw results, Grand Slam finals, player profiles and player season logs, fetched on demand and returned as typed Arrow tables.
Sources and ids
WTA data comes from the official WTA API (the same data behind its rankings and tournaments pages). ATP data, live scoreboards and Grand Slam finals come from ESPN tennis's undocumented endpoints, subject to the Disney terms of use. Player and tournament ids are specific to their source.
Scores
score reads from the winner's side with the tiebreak loser's points in parentheses, e.g. 7-6(5) 6-3. sets holds per-set games for side 1 and side 2.
Catalog
Everything tennis exposes once attached β read straight from the worker's
released build.
main 2 tables Β· 9 functions
ATP and WTA rankings, tournaments, matches and players
Schema 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;
| 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;
current_matches
Every match of the ATP and WTA tournaments in play this week, one row per match
-
set_numberINTEGER
-
side1_gamesINTEGER
-
side2_gamesINTEGER
-
tiebreak_loser_pointsINTEGER
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;
current_rankings
Current ATP (top 150) and WTA (top 200) singles rankings, one row per player
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;
| 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;
all_current_matches ()
Every match of the ATP and WTA tournaments in play today (scan behind current_matches)
-
set_numberINTEGER
-
side1_gamesINTEGER
-
side2_gamesINTEGER
-
tiebreak_loser_pointsINTEGER
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;
all_current_rankings ()
Current ATP and WTA singles rankings (scan behind current_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;
grand_slam_results (season INTEGER, tour := VARCHAR)
Champions, runners-up and scores of every Grand Slam final in a season
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;
matches_on (tour VARCHAR, match_date DATE)
ATP and WTA matches scheduled on one day, with set scores
-
set_numberINTEGER
-
side1_gamesINTEGER
-
side2_gamesINTEGER
-
tiebreak_loser_pointsINTEGER
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;
player (tour VARCHAR, player_id INTEGER, source := VARCHAR)
Profile of one ATP or WTA player
Carlos Alcaraz's ESPN profile.
SELECT player_name, birth_date, height_inches, plays, debut_year
FROM tennis.main.player('ATP', 3782);
player_matches (tour VARCHAR, player_id INTEGER, season := INTEGER, source := VARCHAR)
One ATP or WTA player's match results for a season
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;
rankings (tour VARCHAR, max_rank := INTEGER, ranking_type := VARCHAR)
Current ATP or WTA singles or doubles ranking
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;
tournament_matches (tour VARCHAR, tournament_id INTEGER, season INTEGER, source := VARCHAR)
Every singles and doubles match of one ATP or WTA tournament edition
-
set_numberINTEGER
-
side1_gamesINTEGER
-
side2_gamesINTEGER
-
tiebreak_loser_pointsINTEGER
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');
tournaments (tour VARCHAR, season := INTEGER, source := VARCHAR)
ATP or WTA tournament calendar for a season, with champions
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;
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
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
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 Hide 1 more
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.
Related workers
UFC
Sports
UFC rankings, cards, results, and round-by-round fight stats as SQL tables
Cricket
Sports
Cricket matches, scorecards, ball-by-ball deliveries, standings, and ICC rankings as SQL tables
Formula 1
Sports
F1 standings, results, calendars, lap times, and session timing as SQL tables