skillfed

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.

webargs v8.7.1 3.9M downloads/30d#2,451 on PyPI1,408
Permissive license Active released

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 webargs

uv

uv add webargs

poetry

poetry add webargs

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Internet :: WWW/HTTP :: WSGI :: Application

Tags

http request parsing validationquery parameter validationdeclarative argument validationweb framework request parsingmarshmallow-based request validationrest api argument parsingform data validation
request-validationrest-apiweb-framework

More Dynamic Content packages