StaffCoder
FastAPI

FastAPI Practice Exercises

FastAPI 0.139Python 3.13
7 modules · 28 challengesSign up
Modules7 modules · 28 challenges
Learn how FastAPI turns URLs into handlers: typing the values inside the path so conversion and rejection happen before your code runs, ordering fixed paths ahead of parameterized ones, constraining a segment to a fixed set of choices, and capturing a whole nested path in one parameter.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Typed Path Parameters

Sign up to unlock
89%8 of 9 solvedeasy
About this challenge

This problem covers reading the values that sit inside a web address, so a caller who puts something unexpected there is turned away before any of your code runs.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Route Order And Fixed Paths

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

This problem covers what happens when two addresses could both match the same request, so a page with a fixed name keeps working after a more general pattern is added beside it.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Enum Constrained Categories

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

This problem covers limiting part of an address to a known list of choices, so a typo is refused and told what was allowed rather than quietly answering with nothing.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Storage Browser Routes

STAR
Solving it completes the module
67%2 of 3 solvedeasy
About this challenge

This problem covers laying out the whole set of addresses a file browser needs, so each one reaches the handler it was meant for and none of them quietly swallows another.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

About this path

Routing, Pydantic models, responses, uploads, errors and OpenAPI docs.

Practice FastAPI by building the request and response side of real APIs, one concept at a time. Each challenge opens a FastAPI 0.139 project on Python 3.13 in a browser IDE, and its tests grade your code. The 7 modules cover what every FastAPI endpoint is made of: path operations and routing, query parameters, request bodies with Pydantic models, response models and status codes, form data, file uploads, cookies and headers, error handling, and the metadata that shapes your OpenAPI docs. Each module ends with a larger challenge that pulls its pieces together, such as a catalog search contract, a document portal intake or partner-ready public docs. All 28 challenges are easy. You should be able to write basic Python, including type hints, before you start; no earlier FastAPI experience is needed. More modules are planned. Every module is open on a free account, and on every challenge you choose whether to work with AI agents, AI chat only, or no AI.

Frequently asked questions

9

What will I practice in this path?

7 modules: Path Operations & Routing, Query Parameters, Request Body and Pydantic Models, Response Models and Status Codes, Form Data, Files & Cookies/Headers, Error Handling and Metadata & Documentation.

How many FastAPI exercises are there, and how hard are they?

28 exercises, all easy.

What does this path run on?

Challenges run on FastAPI 0.139 and Python 3.13.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

Does it cover databases, dependency injection or authentication?

Not yet. The current modules cover the request and response layer: routing, parameters, Pydantic models, responses, uploads, errors and docs. More modules are planned.

Do I need to know Pydantic?

No. The Request Body module teaches Pydantic models from the start: field constraints, nested models and validation. Basic Python with type hints is enough.

Can I read a challenge before signing up?

Yes. Every challenge has a public page with its full problem statement. Signing up lets you open it in the browser IDE and run the tests.

Is it free?

Yes. All 7 modules are open on a free account, within the free plan’s weekly hour and monthly solution unlock.

Can I use AI while I solve a challenge?

Yes, if you want to. Each challenge lets you choose how to work: with AI agents, with AI chat only, or with no AI at all.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.