Skip to content

Using Inspectr with Flask

Inspectr is an ideal companion for Python Flask applications, giving you a clear view of all HTTP traffic, helping you debug issues, and even enabling you to expose your local API to the internet for testing.

This guide shows how to use Inspectr with Flask.


  • Python 3.8+
  • Flask installed (pip install flask)
  • Inspectr installed (Install guide →)

Create a simple Flask app (app.py):

from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/hello', methods=['GET'])
def hello():
return jsonify({"message": "Hello from Flask!"})
if __name__ == '__main__':
app.run(port=5000)

Start your app:

Terminal window
python app.py

Terminal window
inspectr --listen=:8080 --backend=http://localhost:5000

Make a request via Inspectr:

Terminal window
curl http://localhost:8080/hello

Inspectr will forward the request to Flask, capture the response, and show it in:


Terminal window
inspectr \
--listen=:8080 \
--backend=http://localhost:5000 \
--expose \
--channel=flask-demo \
--channel-code=flask123

Your app is now accessible via:

https://flask-demo.in-spectr.dev

Inspectr makes it easy to debug Flask APIs and receive traffic from external sources:

  • Local proxy for inspection
  • Public exposure with access control
  • Live UI for inspecting and replaying traffic