How to Solve NameError: name 'Api' is not defined -- flask_restful

Solution: Import the 'Api' module

To Solve the error, add the following line to the top of your code.

from flask_restful import Api

 

For more information:
Python flask_restful Api