flask-swagger-ui
Swagger UI blueprint for Flask
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-uiuv
uv add flask-swagger-uipoetry
poetry add flask-swagger-uiInstalling 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
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
flask-swaggerExtracts Swagger 2.0 API specifications from…
permissive · top 15,000 on PyPI
swagger-ui-bundlePackages Swagger UI's static files and…
permissive · top 5,000 on PyPI
swagger-ui-pyIntegrates Swagger UI documentation into Python…
permissive · top 15,000 on PyPI
aiohttp-swaggerGenerates Swagger API documentation and…
permissive · top 15,000 on PyPI
flask-openapi3-swaggerProvides Swagger UI integration for…
permissive · top 15,000 on PyPI
flask-restxFlask-RESTX extends Flask with decorators and…
permissive · top 5,000 on PyPI
mkdocs-render-swagger-pluginRenders Swagger and OpenAPI schemas as…
permissive · top 15,000 on PyPI
mkdocs-swagger-ui-tagA MkDocs plugin that embeds Swagger UI directly…
permissive · top 15,000 on PyPI
flask-restplusFlask-RESTPlus adds decorators and tools to…
permissive · top 15,000 on PyPI
swagger-plugin-for-sphinxA Sphinx plugin that embeds interactive Swagger…
permissive · top 5,000 on PyPI