I've already built a python script that scrapes some data from a website that require a login-in. My question is: How can i transform this script into an api? For example i send to the api username, password and data required, then it returns the data needed.
A web API is nothing but an HTTP layer over your custom logic so that requests can be served the HTTP way (GET PUT POST DELETE).
Now, the question is, how?
The easiest way is to use already available packages called "web frameworks" which python has in abundance.
The easiest one to probably implement would mostly be Flask.
For a more robust application, you can use django as well.
Web Scraping Api with Python