webargs
Declarative parsing and validation of HTTP request objects, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, Falcon, and aiohttp.
What it is and what it does
webargs is a declarative HTTP request parsing and validation library built on top of marshmallow schemas. It lets you define what arguments your web endpoint expects—their names, types, and validation rules—then automatically extracts and validates them from incoming requests. Instead of manually checking request objects and writing validation code, you decorate your handler with a schema and webargs handles the rest, returning either validated data or raising validation errors.
The library integrates with popular Python web frameworks including Flask, Django, Bottle, Tornado, Pyramid, Falcon, and aiohttp, so you use the same schema definitions across different frameworks. It supports extracting arguments from query strings, form data, JSON bodies, headers, and cookies. The underlying validation engine is marshmallow, so you get all of marshmallow's field types, custom validators, and error handling.
Use it for:
- Validate query parameters in a REST endpoint without writing manual type checks or try-catch blocks.
- Parse and validate JSON request bodies in an API view using declarative field schemas.
- Extract and coerce form data in a handler, with automatic error responses for invalid input.
- Centralize request validation logic across multiple endpoints using reusable marshmallow schemas.
- Build a REST API where request validation errors are automatically formatted and returned to clients.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
webargs parses and validates HTTP request arguments (query strings, form data, JSON bodies, headers) against declarative schemas, with built-in support for Flask, Django, Bottle, Tornado, Pyramid, Falcon, and aiohttp.
Yes. webargs is a mature, actively maintained library in production/stable status with no known vulnerabilities, low install friction, and broad framework support. It solves a common problem—request validation—in a declarative, reusable way. Install it if you are building web APIs or handlers in any of the supported frameworks and want to avoid manual argument parsing and validation boilerplate.
Install
webargs on PyPI
pip
pip install webargsuv
uv add webargspoetry
poetry add webargsInstalling webargs
Before you install
Low install friction; pure Python wheel with only three runtime dependencies (marshmallow, packaging, typing_extensions). Actively maintained with recent releases and no known vulnerabilities.
License in practice
MIT licensed under permissive terms, allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install webargs
from webargs import fields
from webargs.flaskparser import use_args
@use_args({"name": fields.Str(required=True)}, location="query")
def index(args):
return "Hello " + args["name"]
Requires Python 3.9 or later; also requires the web framework you intend to use (e.g., Flask for the example above).
Verify before relying
- Whether webargs automatically coerces types beyond what marshmallow provides by default.
- Performance characteristics when validating large request payloads or deeply nested schemas.
- Exact scope of framework support—whether all listed frameworks are equally maintained.
- Whether all supported frameworks (Flask, Django, Bottle, Tornado, Pyramid, Falcon, aiohttp) are actively maintained in webargs.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — marshmallow, packaging, typing_extensions |
| Maintenance | actively maintained — 289 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,929,873/month — #2,451 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: webargs-8.7.1-py3-none-any.whl
Keywords: webargs, http, flask, django, bottle, tornado, aiohttp, request, arguments, validation, parameters, rest, api, marshmallow
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-apispecflask-apispec decorates Flask view functions…
permissive · top 15,000 on PyPI
apispec-webframeworksProvides web framework plugins for apispec to…
permissive · top 15,000 on PyPI
jsonschemajsonschema validates Python data structures…
permissive · top 100 on PyPI
marshmallowMarshmallow converts complex Python objects to…
permissive · top 1,000 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
hughug is a Python framework for building REST…
permissive · top 15,000 on PyPI
flask-marshmallowFlask-Marshmallow integrates Flask and…
permissive · top 5,000 on PyPI
APIFlaskAPIFlask is a lightweight web API framework…
permissive · top 15,000 on PyPI
Flask-WTFFlask-WTF integrates WTForms with Flask to…
permissive · top 5,000 on PyPI