Skip to content

Build and Deploy Your First API

Build a small web API with FastAPI, document it with OpenAPI and Swagger UI, test it with Postman and pytest, and deploy it.

Read every lesson as a guest, or sign in to enroll and track your progress.

What you'll learn

By the end of this course, you will be able to:

  • Explain an HTTP request from client to server.
  • Build a validated FastAPI service.
  • Document an API with OpenAPI and Swagger UI.
  • Explore and test an API with Postman.
  • Test success and error responses.
  • Deploy a small service with configuration and health checks.

About this course

An API (application programming interface) lets one program use another program’s features. A web API does this over the internet: a program sends a request to a URL, and the API sends back data. When an app shows a prediction from an AI model, there is almost always a web API between the app and the model.

In this course, you build one: a small service that reads a support ticket and predicts its category and priority. The prediction comes from a simple keyword classifier, so every result is predictable and you can check it by hand. Later courses replace it with a trained model, with no change to the API around it.

You do not only write the code. You document the API so that another developer can use it without asking you, with OpenAPI and Swagger UI. You explore and test it with Postman, the tool that many teams use to work with APIs every day. You test it automatically with pytest, protect it, and deploy it to a public URL.

Each lesson shows real requests and responses, and a common mistake: what you see, why it happens, and how to recover.

Before you start

You completed Python for Practical AI Engineering, or you can already set up a virtual environment, write functions and modules, read a traceback and write pytest tests. You do not need to know how the web works. Module 1 explains it.

Courses to take first: Python for Practical AI Engineering.

Who this is for

People who can write and test a small Python project, as in the Python course, and want to offer their code to other programs through a web API. Most AI features reach their users this way.

How we made this course

Experienced AI practitioners designed this course. AI helped us draft the content; people chose the teaching approach and the examples, and reviewed every lesson. The outputs that you see are the actual results of running the code. How we make our courses

Inside the course

Module 1Understand the web request

3 lessons

Follow a request from your computer to a server and back. You learn the parts of a URL, what DNS, ports and HTTPS do, and how to read a request and its response with the browser's developer tools and curl.

  1. Browser-to-server basics30 min
  2. HTTP fundamentals35 min
  3. Inspect a request35 min

Module 7Deploy and verify

3 lessons

Deploy the service to a managed host, with its settings and secrets outside the code. Then check it with the same Postman collection, read its logs, and remove it when you are done.

  1. Hosting bridge40 min
  2. Publish safely45 min
  3. Verify and clean up45 min

Final module · choose at least oneCase studies

2 case studies

Two end-to-end case studies on real data, as projects that you download and run in VS Code. Serve a house-price model behind a validated, tested and deployed API, and build a read-only data API with filters and stable pagination. Complete at least one for the certificate; each one is a portfolio piece.

Complete at least one case study for the certificate. The others are optional. What each one covers

  1. Serve a house-price model240 min
  2. Build a data API for city service requests300 min

After the case studiesFinal assignment

Use every module in one practice project. You collect evidence, and check it against the course outcomes.

  1. Final assignment300 min

Case studies

Realistic projects from start to finish, on real data, with every output explained. Each one makes a portfolio piece. Complete at least one for the certificate; the others are optional.

  1. Serve a house-price model4 hr

    Wrap a ready-made model in a validated, tested, documented and deployed estimate API.

  2. Build a data API for city service requests5 hr

    A read-only API over a real database: filters, stable pagination, daily statistics, tests and the deployment steps.

Reviews

Loading the reviews…

    Took this course? Sign in to review it. Learners can write a review after they complete 25% of the lessons.

    Share this course