skillfed

flask-swagger-ui

Swagger UI blueprint for Flask

flask-swagger-ui v5.32.12 826.3K downloads/30d#4,961 on PyPI187
Permissive license MIT Active released

What it is and what it does

flask-swagger-ui is a Flask blueprint that embeds Swagger UI directly into your Flask application, allowing you to serve interactive API documentation from any Swagger/OpenAPI specification. It wraps the official Swagger UI (currently version 5.32.12) and exposes it at a configurable URL path, letting developers and API consumers explore endpoints, try requests, and view schemas without leaving your app.

The package is lightweight—it depends only on Flask—and stays current with Swagger UI releases through an automated weekly update process. You configure it by passing a specification URL (local or remote) and optional Swagger UI settings to a factory function, then register the resulting blueprint with your Flask app. It supports standard Swagger UI configuration options that can be JSON-serialized, including OAuth2 parameters, but does not support plugins or custom function parameters.

Use it for:

  • Embed interactive API documentation in a Flask microservice without external hosting or separate documentation sites.
  • Let API consumers test endpoints directly from your application with a familiar Swagger UI interface.
  • Serve Swagger UI for a remote OpenAPI specification (e.g., from a third-party API) alongside your own Flask routes.
  • Configure OAuth2 authentication flows within Swagger UI for APIs that require token-based access.
  • Keep API documentation in sync with your Swagger UI version by relying on automatic weekly updates.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds Swagger UI to Flask applications as a blueprint, serving interactive API documentation from a Swagger/OpenAPI specification URL.

Yes. Low install friction, permissive MIT license, active maintenance (weekly updates), no known vulnerabilities, and a single Flask dependency make this a straightforward choice for adding Swagger UI to Flask apps. The trade-off is that plugins and custom function parameters are not supported—if you need those, you would need to serve Swagger UI separately or fork the package.

Install

flask-swagger-ui on PyPI

pip

pip install flask-swagger-ui

uv

uv add flask-swagger-ui

poetry

poetry add flask-swagger-ui

Installing flask-swagger-ui

Before you install

Low friction: pure Python wheel with only Flask as a runtime dependency. Actively maintained on a weekly update cycle to track Swagger UI releases, with recent activity (last commit 2026-08-03).

License in practice

MIT license permits unrestricted commercial and private use, modification, and distribution with minimal obligations.

Quickstart

pip install flask-swagger-ui

from flask import Flask
from flask_swagger_ui import get_swaggerui_blueprint

app = Flask(__name__)
swaggerui_blueprint = get_swaggerui_blueprint(
    '/api/docs',
    'https://petstore.swagger.io/v2/swagger.json'
)
app.register_blueprint(swaggerui_blueprint)
app.run()

Verify before relying

  • Whether the weekly Swagger UI update cycle is fully automated or requires manual review before release
  • Performance impact of serving Swagger UI on applications with high traffic
  • Support status for Swagger UI features beyond JSON-serializable configuration (plugins, custom functions)

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — flask
Maintenance actively maintained — 11 days since the last release
Last repo commit
First released
Downloads 826,336/month — #4,961 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flask_swagger_ui-5.32.12-py3-none-any.whl

Keywords: flask, swagger

Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: Python :: 3

Tags

flask swagger ui documentationswagger ui flask blueprintopenapi documentation flaskapi docs flaskswagger ui integration flaskinteractive api documentationflask api explorer
api-documentationswagger-openapi

More Dynamic Content packages