Skip to content

About

Example: tennis matches, live scores, results, H2H and rankings with the Orbots Tennis Scraper on Apify

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tennis Scraper example: matches, live scores, results and H2H in Python

Unofficial example. Orbots is not affiliated with, sponsored by, or endorsed by Flashscore (Livesport s.r.o.), TennisExplorer, the ATP, the WTA or the ITF. Those names are used here only to describe the public data the Actor collects.

A small Python script that runs the Tennis Scraper Actor on Apify and prints the result as a plain table: today's matches with live scores, yesterday's results with set-by-set scores, the head-to-head record of two players, or the ATP and WTA rankings. It covers ATP, WTA, Challenger, ITF and team events, with no login, no browser and no scraping code on your side. Built and maintained by Orbots.

Run the Actor on Apify: https://apify.com/orbots/tennis-scraper


What you need

  • Python 3.11 or newer.
  • An Apify account (the free plan works) and your API token, from Apify Console > Settings > API & Integrations.

Setup

git clone https://github.com/orbotshq/tennis-scraper-example.git
cd tennis-scraper-example
pip install -r requirements.txt
export APIFY_TOKEN="your_apify_token"

On Windows PowerShell, set the token with $env:APIFY_TOKEN = "your_apify_token".

Each command below starts one run of the Actor, waits for it (a few seconds) and prints the rows. The script also prints the input it sent, the run ID and a link to the run in your Apify Console, where the same rows can be exported as JSON, CSV or Excel.

Example 1: today's matches with live scores

python example.py schedule --tours ATP WTA --max 10

schedule returns today's matches that are not finished yet: the ones in play, with the games of every set, the points of the current game and who is serving, and the ones still to come. Use live for the matches in play only, or all for the whole day with finished matches included.

Real output, 2026-11-02 at 11:10 UTC:

Start (UTC)       Tournament     Players                      Status       Score             Winner
----------------  -------------  ---------------------------  -----------  ----------------  ------
2026-11-02 10:10  ATP Paris      Musetti L. vs Hurkacz H. *   live, set 2  7-6(3) 2-1 [0:0]
2026-11-02 10:10  ATP Paris      Buse I. vs Bergs Z. *        live, set 2  6-2 3-1 [0:0]
2026-11-02 10:10  ATP Paris      Darderi L. vs Hijikata R. *  live, set 2  2-6 1-4 [15:0]
2026-11-02 10:30  WTA Chennai    Sawangkaew M. vs Hontama M.  scheduled
2026-11-02 10:30  WTA Chennai    Vandromme J. vs Okamura K.   scheduled
2026-11-02 10:30  WTA Chennai    Falei A. vs Linette M.       scheduled
2026-11-02 10:40  WTA Hong Kong  Williams V. * vs Stoiana M.  live, set 1  2-4 [15:40]
2026-11-02 11:30  ATP Paris      van Assche L. vs Navone M.   scheduled
2026-11-02 12:00  WTA Chennai    Uchijima M. vs Sramkova R.   scheduled
2026-11-02 12:00  ATP Paris      Tabilo A. vs Jodar R.        scheduled
* = serving now, [x:y] = points in the current game

Example 2: yesterday's results with set-by-set scores

python example.py results --date yesterday --tours ATP WTA --max 10

Finished matches with the score of every set and the winner. --date takes today, yesterday or any YYYY-MM-DD (UTC): the last 7 days come from Flashscore, older dates (back to the 1990s) from the TennisExplorer archive. Add --date-to for a range of up to 31 days.

Real output from a run on 2026-11-02 (yesterday was Sunday 2026-11-01, with qualifying rounds in Hong Kong, Chennai and Paris):

Start (UTC)       Tournament                   Players                           Status    Score        Winner
----------------  ---------------------------  --------------------------------  --------  -----------  ------------
2026-11-01 02:10  WTA Hong Kong Qualification  Sasnovich A. vs Lee C. Y.         finished  6-2 6-1      Sasnovich A.
2026-11-01 02:10  WTA Hong Kong Qualification  Prozorova T. vs Stojsavljevic M.  finished  6-4 6-1      Prozorova T.
2026-11-01 03:10  WTA Tokyo                    Fernandez L. vs Shnaider D.       finished  4-6 7-5 2-6  Shnaider D.
2026-11-01 03:35  WTA Hong Kong Qualification  Sakatsume H. vs Pridankina E.     finished  5-7 6-2 6-2  Sakatsume H.
2026-11-01 03:45  WTA Hong Kong Qualification  Jones E. vs Shubladze A.          finished  4-6 2-6      Shubladze A.
2026-11-01 08:35  WTA Chennai Qualification    Okamura K. vs Kobori M.           finished  3-6 6-3 6-3  Okamura K.
2026-11-01 08:40  WTA Chennai Qualification    Falei A. vs Zolotareva R.         finished  6-4 4-6 7-5  Falei A.
2026-11-01 08:40  WTA Guangzhou                Tagger L. vs Dart H.              finished  6-4 3-6 4-6  Dart H.
2026-11-01 08:45  WTA Chennai Qualification    Morvayova V. vs Falkowska W.      finished  3-6 7-5 4-6  Falkowska W.
2026-11-01 10:05  ATP Paris Qualification      Hijikata R. vs Kopriva V.         finished  7-6(5) 6-2   Hijikata R.

Example 3: head-to-head of two players

python example.py h2h --pair "Alcaraz vs Sinner"

The record between two players and every previous meeting, with year, tournament, surface, round, winner and score. Names are plain text; add the first name when a surname is shared. Repeat --pair to ask for more pairs in the same run.

Real output, 2026-11-02:

Alcaraz Carlos vs Sinner Jannik: 12-9 in 21 meetings
Year  Tournament            Surface  Round  Winner      Score
----  --------------------  -------  -----  ----------  ----------------------------
2026  Monte Carlo           clay     F      Sinner J.   7-6(5) 6-3
2026  Incheon - exhibition  indoors         Alcaraz C.  7-5 7-6(6)
2025  Masters Cup ATP       indoors  F      Sinner J.   7-6(4) 7-5
2025  Six Kings Slam        indoors  F      Sinner J.   6-2 6-4
2025  US Open               hard     F      Alcaraz C.  6-2 3-6 6-1 6-4
2025  Cincinnati            hard     F      Alcaraz C.  5-0
2025  Wimbledon             grass    F      Sinner J.   4-6 6-4 6-4 6-4
2025  French Open           clay     F      Alcaraz C.  4-6 6-7(4) 6-4 7-6(3) 7-6(2)
2025  Rome                  clay     F      Alcaraz C.  7-6(5) 6-1
2024  Riyadh - exhibition   indoors  F      Sinner J.   6-7(5) 6-3 6-3
11 older meetings are in the dataset (add --json to see every one)

More options

Option Actor input What it does
schedule, live, results, all, match, h2h, rankings mode What to collect (first argument).
--date, --date-to dateFrom, dateTo Days to collect: today, yesterday or YYYY-MM-DD, UTC; up to 31 days per run. In rankings mode, --date picks a past edition (rankingDate).
--tours tours Any of ATP, WTA, Challenger, ITF, Teams. The Actor's default is all of them but ITF.
--match-type matchType singles (the Actor's default), doubles or all.
--tournament tournament Only tournaments whose name contains this text.
--player players Only matches with this player; repeat for more.
--max maxMatches Hard cap on match rows per run; 20 in this script.
--only-new onlyNew Only matches that are new or changed since your earlier runs.
--match-id matchIds match mode: serve and return statistics and point by point of these matches.
--pair pairs h2h mode: two players, such as "Alcaraz vs Sinner"; repeat for more.
--ranking-tour, --top rankingTour, rankingTop rankings mode: atp, wta or both, and how many players from the top (up to 2000).
--max-charge run option Stop the run once it has charged this many USD.
--json Print the raw rows as JSON lines, with every field.

A few more:

python example.py live --tours ATP WTA Challenger --match-type all
python example.py results --date 2026-10-26 --date-to 2026-11-01 --player Sinner
python example.py rankings --ranking-tour wta --top 50
python example.py all --tours ATP WTA --json > today.jsonl

For a live feed, run live every few minutes with --only-new: each run returns only the matches whose status or score moved since the previous one, so the same row is not charged twice. A cron job works, and so does a schedule in the Apify Console, with no script at all.

Without Python

The same data in one HTTP request; the call waits for the run and returns the rows as JSON:

curl -X POST "https://api.apify.com/v2/acts/orbots~tennis-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode": "results", "tours": ["ATP", "WTA"], "maxMatches": 20}'

Every input field and the full output format are documented on the Actor page.

Pricing

Pay per event, in USD: a small start fee per run plus a fee per row delivered, so a run of this script with its default cap of 20 matches costs a few cents and a run that delivers nothing costs nothing (current prices on the Actor page).

Support

Questions, bugs and feature requests: open an issue in this repository, or use the Issues tab on the Actor page.

More from Orbots: orbotshq.github.io and the Apify Store profile.

License

MIT, see LICENSE. The license covers this example script; the Actor and the data it returns are governed by their own terms on Apify.


Orbots builds small, reliable data Actors on Apify. Data is read from publicly available sources; see each Actor's page for details and terms.

About

Example: tennis matches, live scores, results, H2H and rankings with the Orbots Tennis Scraper on Apify

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages