Search code examples
pythonpython-requestsapi-designflask-restplus

How to call an API in Flask Restplus?


I'm trying to figure out how can I call an API using Flask-Restplus (normally, I'd just use API key, as it always was possible - let's say the easiest example is weather). I know how I can do it in Flask, but have no idea how can I do it in Restplus. There are tons of documentations, but mostly about working with local database. I don't understand how I can call a real weather API inside Restplus. If you can explain it to me or provide an example, I'd appreciate that very much. Also I have 2 files - one for an endpoints, 2nd for the calls, and I can't understand how I can invoke the call or connect those two files. Thanks in advance!


Solution

  • Flask-RESTPlus package deals with creating and exposing APIs. If you need to access external APIs within your application you are suppose to use Requests package.