What is a REST API?
API is a way to get a response from an HTTP request.
Ok, but what is this HTTP request?
A request can be considered as telling what we want to do. Here are two basic and most used requests
1. GET
It is to request some data from the application, it is like how we ask for some information when we go to a shop and they tell us.
If you want to understand it from a data point of view, it can be considered a Read operation, but the API will do something in the background and give us what we want to read.
Example: When I click on a article I create a GET request which will make a call to some function on server to compute the data and send it to me which then gets renderred into format I see on my screen.
2. POST
It is sending data to the server for performing some operations, it is like posting a letter in a postbox. You give data to do something in the background. This might give you some data back or just take data and perform something which you see somewhere else.
Example: When I write & publish a article here I send the test data along with other formatting data I made here to server via POST request. Which takes this text data and stores it in database. When someone wants to read the article a GET request is triggered which will read from the database and display the data.
There are many other types of requests. The type of request used to perform some operation depends on the way it is created by the developer of that operation. Anyone can create any kind of request to an endpoint. An endpoint is a path or route to create a request.
Postman is a very good tool to create different requests and get a good understanding by playing with APIs. Below is a screenshot of the postman application in which you can see that you can create different kinds of requests to play with APIs.

Ok, What is this REST part for APIs. REST stands for Representational state transfer.
Ok 🙄, what does it mean?
So REST APIs are the APIs which gives the data a single time for a single request.
Let’s say you made a GET request to the a API to get the article. Now all the data that is displayed to you will be bagged into a single block and will be sent from the server. So the data you got from the API won’t change until you make another request to get data or a refresh time is reached for the article display.
Let’s consider another case where I am streaming a video. Now the data I see on screen changes from time to time. It won’t be like I got the whole video file in a single block and I am seeing it at a point where I want. This kind of APIs are called as Streaming APIs.
In Streaming APIs a standard connection pipeline is established between user and server via which the API will send chunks of data from time to time based on the users interaction with UI.
Coming back to REST APIs, it is very eay to create a REST API. A number of frameworks are available which we can use to create APIs.
Python, Nodejs, Golang , Java, Javascript what ever progamming language it is mostly every progamming language has frameworks which can be used to ceate REST APIs easily.
Below is a code snippet in which a GET request created using python on FASTAPI framework.
from fastapi import FastAPI app = FastAPI()
@app.get(“/welcome”)
def hello_api():
return {“Welcome”: “to REST APIs”}