Forums

WebApp or API ?

Hi,

I would like to use PythonAnywhere to host a backend code, basicaly working just as an API. In short, it should receive (or get, I don't care which side make the requests) some information and process it, basicaly it will change de format of a document and than it should send it back (as a reponse or a Push). I must notice that the start of the exchange will be by the other side, another web app will call PythonAnywhere and then it will do his thing.

I want to know if I can just create a Web App that runs the code I need when it gets called or should I use PythonAnywhere API ? Which one whould you advise ? What would be the difference ? (note that I don't need any user interface in the PythonAnywhere side). Also, if I use an Web App here, I can make a private connection, or have some sort of privacy of the data ?

(Also, is there other way to create a Endpoint in PythonAnywhere other than WebApp or PythonAnywhere API?)

Thank you in advance.

PythonAnywhere API is an API to ease automation of some jobs on the users' accounts (like managing tasks, getting some information, etc.). If you want to expose your own API, that's definitely something for a web app.

Ah, thanks! Just to check, so if I want to code a Token-based Authentication I need to code it myself in the WebApp, right ?

Yes, although you'd probably want to use a web framework (like Django or Flask) which could provide a lot in terms of authentication.