Building and integrating
What is REST API in Python?
Python can be used to call a REST API or to build one. Calling an API means asking another service for information or an action. Building an API means creating a way for other programs to ask your application for something. REST is a set of principles for designing these exchanges.
Imagine you write a Python program that suggests what to wear. It asks an external weather service for the temperature in Paris. The service returns weather data, and your program uses it to suggest a jacket. You do not need to measure the weather yourself.
Requests is a Python library, a collection of ready-made code, that helps send these requests. FastAPI helps you build your own API instead. Start by using an existing API to understand the conversation between the two programs.
Your code uses the provider’s weather data. You do not need to build a weather service yourself.