FastAPI

Your quote says FastAPI. That covers the API, not the whole product.

The short answer

FastAPI is free, open-source Python software for building APIs: the part of a product other software talks to, rather than the screens people look at. It reads the types already written in the code to check incoming data and to publish its own interactive documentation. It's narrower than Django on purpose.

There's a line in the proposal that says FastAPI, and it reads like the name of the thing being built. It's the name of one layer. Which layer decides what else has to be in the same quote, so it's worth ten minutes before you agree a number.

It builds the API, and an API isn't the whole product

Start with what an API is, because the rest follows. It's the part of a system other software talks to. A phone app asking for this month's invoices, a payment provider reporting that a charge cleared. No pages, no buttons. Requests in, structured answers out.

FastAPI is free, open-source Python software for building that layer, published under the MIT licence. It's a library a developer builds with, not a product anybody signs into.

In Python the comparison is always Django, usually framed as old against new. Wrong axis. Django arrives with a database layer, an admin screen, logins and page templates, and expects you to build its way. FastAPI arrives with almost none of that, by design.

One set of declarations doing four jobs

The idea underneath the framework is small. Python lets a developer note what kind of thing each value is: a whole number, a date, a list of order lines. Those notes are called type hints, and in ordinary Python nothing acts on them.

FastAPI treats them as instructions. From the same lines it checks that an arriving request matches, turns raw text into real dates and numbers, refuses anything malformed with a reply naming the field that failed, and describes the endpoint in a standard machine-readable format.

That's why the code reads short. Very little of it checks input, because the description of the data is the check.

  1. 01

    A request arrives

    From an app, a partner system or a browser. Text, and untrusted.

  2. 02

    Checked against the types

    A missing field or an unreadable date gets a reply naming what failed.

  3. 03

    The code runs

    It receives real values of the right kind, so nothing guesses.

  4. 04

    The answer goes back

    Shaped by a declared response type, so nothing unintended leaks out.

One set of type declarations does four jobs: screening the request, handing the code real values, shaping the reply, and describing the endpoint for callers.

The documentation writes itself

Because every endpoint is already described in a standard format, FastAPI serves that description as a page you open in a browser: every field it expects, every field it returns, and a button that fires a real request so somebody can try one without writing code.

Hand-written API documentation goes stale the week after a field changes, and you find out when a partner's integration breaks. Generated documentation can't be wrong about the shape.

The benefit lands on somebody else's desk: another team, a contractor, a customer's developers. Two caveats. It describes shape, not meaning. And it's often switched off in production, since a public copy describes your whole interface.

Async in plain language, and why AI work lands here

FastAPI handles many requests at once by letting one process get on with something else while it waits. The waiting is the point. Most of what an API does is wait: for the database, for a payment provider, for someone else's slow server.

Waiting isn't working, and that decides whether this helps you. A request that needs real calculation gains nothing, and heavy calculation inside one request holds up the others unless somebody deliberately moves it aside. That's a code mistake rather than a flaw in the framework.

It also explains why FastAPI turns up around machine learning work. The models and the libraries live in Python, so the service in front of them may as well be. Running a model is calculating rather than waiting, though, so what suits an ordinary API doesn't transfer.

Where it stops

There's no admin screen, no database layer of its own, no user accounts, no templates as the main event, and nothing that manages changes to your database structure as it evolves. Each is a separate choice, made from libraries that don't necessarily agree with one another.

For a team that knows what it wants, that's freedom. On a first product with nobody senior making the calls, it's five decisions with no default, and whoever joins second inherits one person's taste.

The limit that shows up on every project is simpler. Nothing here draws a screen. A proposal naming FastAPI has named part of the stack and left the interface open, and that half is usually the larger number.

FastAPI

A full-stack framework

What arrives on day one

FastAPI: An API layer and input checking. Database, logins and admin are yours to wire up.

A full-stack framework: Database layer, admin and logins included. You build its way, even where that doesn't suit you.

Screens for your own staff

FastAPI: Nothing built in, so an internal tool is its own project and budget.

A full-stack framework: An admin screen for free, looking like the framework rather than your product.

Hiring and handover

FastAPI: Less framework to learn, and less structure handed over with the code.

A full-stack framework: A long-settled pattern, with more of it to learn before someone is useful.

Three questions asked of both. Every answer costs something, and the costs land in different places.

Who has to be around afterwards

A service like this is a codebase and a running process, not something anybody signs into. Every change is a developer, a code change and a deploy. No colleague edits a value on a screen.

The upkeep is small and never zero: the Python version, the framework, the libraries around it, and the container it runs in. Leave it alone for two years and nothing stops working. The next change just costs more, because somebody catches up on the updates first.

So settle one name before the technology. Who runs this in year two? If the answer is whoever built it, and they're gone when the project ends, that's the thing to plan around.

Worth knowing before you start

  • Ask which library handles the database and which one handles logins, by name. FastAPI supplies neither, so those answers describe the build better than the framework name does.

  • Ask whether the interactive documentation page is reachable in production, and by whom. It's the quickest way for a partner's developer to get moving, and a complete description of your interface.

  • Ask what happens to work that takes longer than a request reasonably should. If the answer is a background task inside the same process, that work disappears on the next deploy.

  • If any request has to do real calculation, ask how it's kept from slowing everything else down. A team without a ready answer usually hasn't run the thing under load.

Common questions

The framework is, under the MIT licence, with no account or plan attached. You pay for the server it runs on and the database behind it, like anything else in this category.

Scope, not age. Django hands you a database layer, an admin screen, logins and templates, and expects you to work its way. FastAPI hands you the API layer and leaves the rest open. Mostly screens over a database favours Django. A service other software calls favours FastAPI.

Not really, and it isn't trying to. It can return HTML pages, but nothing about it is aimed at that job. In almost every build something else draws the interface and calls it.

For what it does, yes, though the word covers two things. It handles a lot of simultaneous waiting well, which is what most APIs spend their time doing. It won't make your database queries or your model quicker.

It's a fair default: the models are already in Python, so the service in front of them may as well be. What it doesn't settle is the hard part: how long a response takes, what happens when the model is busy, and what to do with a request that runs far longer than a web request should.

Related

Want to talk through your situation?

A short call is usually enough to tell whether this is the right work for you. If it isn’t, we’ll say so.