Skip to content
Live Tennis API Free API key ↗
Menu
For teachers

Free tennis API exercises for Python and JavaScript classes

Live Tennis API publishes eight graded coding exercises for classes that work with a real JSON API. Each one comes in Python and JavaScript, with tests that run offline against recorded responses. The code is free to use and adapt under the MIT licence, and the live parts run on the free plan.

Open the exercises on GitLabRead the teacher guide on GitLab

What do students learn?

Students start by calling a health endpoint. By the end they have built a terminal scoreboard that polls live scores without running out of requests. They need to know functions, loops and dictionaries (or objects in JavaScript), and nothing else.

The exercises, with level and time
ExerciseStudents learn toLevelTime
1. First requestcall an endpoint with no key, then with a key from the environmentBeginner30 min
2. Read a scoreturn player-major score arrays into a line such as "6-4 3-4, 30-15"Beginner45 min
3. Break pointswrite a pure function with careful edge casesIntermediate40 min
4. Filter and groupgroup live matches by tour and count them by tournamentIntermediate45 min
5. Player searchhandle zero, one and many search resultsIntermediate45 min
6. Rate limits and quotarespect a per-minute limit, retry a 429 and read your quotaAdvanced60 min
7. Errorsturn 401, 403 and 404 responses into messages people understandIntermediate45 min
8. Terminal scoreboardpoll live scores at a rate that fits the daily quotaAdvanced90 min

The teacher guide maps each exercise to these outcomes.

Do students need an API key?

Not for the tests. They replay recorded responses, so a student can finish every exercise with no network and no key. Exercises 2, 3 and 4 never touch the network at all, which suits a lab with no internet.

For the live runs, each student gets their own free key, with no card. The free plan allows 30 requests a minute and 100 a day. Never give the whole room one key, because thirty students on it would hit the minute limit straight away. The guide plans a typical student's day of requests so it fits.

How does it fit a course?

How do I grade it?

Each exercise is worth 10 points. Six come from the tests and four from reading the code: two for correctness beyond the tests, two for clarity. The guide lists what earns the correctness points in each exercise, and the mistakes students make most often.

Worked solutions sit next to the starters. For graded work, give students a copy without the solutions folders. The GitLab pipeline then grades their starters, and goes green once every test in both languages passes. If you teach one language, delete the other job from the pipeline file.

Can I change the exercises?

Yes. The code is under the MIT licence, so you can copy, change and hand it out. The recorded responses are under CC BY 4.0, credited to Live Tennis API. The project's CITATION.cff file has the details if you cite the set in a syllabus or a paper.

Are you teaching with it?

We would like to hear how it went, what worked and what confused students. Email hello@livetennisapi.com. We never publish anything about a class without the teacher's consent. Problems with an exercise are welcome as issues on the GitLab project too.

Teaching or researching with match data instead? See the free academic dataset.

This page describes exercise set version 1.0.0, released 23 October 2026. The GitLab project always holds the latest version.