skillfed

schemathesis

Adaptive API testing for OpenAPI and GraphQL

schemathesis v4.24.3 6.7M downloads/30d#1,862 on PyPI3,526
Permissive license MIT Active released

What it is and what it does

Schemathesis is a property-based testing framework for OpenAPI and GraphQL APIs. It reads your API schema, generates test cases covering edge cases and invalid inputs, sends them to your API, and validates that responses match the schema and don't crash. It can also chain operations together to test realistic workflows—for example, creating a resource, fetching it, and deleting it in sequence—to catch bugs that only appear when operations interact.

The package integrates with pytest and Hypothesis to run tests both from the command line and within Python test suites. It supports multiple reporting formats (Allure, JUnit XML) for CI/CD pipelines and can adapt its test generation based on server responses. With 15 runtime dependencies including click, requests, pyyaml, and rich, it provides a complete testing toolkit without requiring external tools.

Use it for:

  • Catch 500 errors and crashes caused by edge-case inputs before users encounter them in production.
  • Verify that your API returns data matching your OpenAPI schema and rejects invalid inputs correctly.
  • Test multi-step workflows like user creation, retrieval, and deletion to find bugs in operation sequencing.
  • Integrate API testing into CI/CD pipelines using GitHub Actions or other tools via JUnit XML reports.
  • Fuzz-test GraphQL APIs to find schema violations and unexpected server behavior.

Worth the install?

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

Schemathesis generates test cases from OpenAPI and GraphQL schemas to automatically find API bugs through property-based testing, including edge cases, schema violations, and stateful workflow failures.

Yes. Schemathesis is actively maintained, has low install friction, carries no security vulnerabilities, and uses a permissive MIT license. It solves a real problem—finding API bugs through automated schema-driven testing—and is used by established companies like Spotify, WordPress, JetBrains, and Red Hat. Install it if you own or test an OpenAPI or GraphQL API and want to catch bugs before users do.

Install

schemathesis on PyPI

pip

pip install schemathesis

uv

uv add schemathesis

poetry

poetry add schemathesis

Installing schemathesis

Before you install

Low friction: pure Python wheel with 15 runtime dependencies including hypothesis, pytest, and requests. Active maintenance with a release 20 days ago and 3526 GitHub stars. Supports Python 3.10 through 3.14.

License in practice

MIT license (permissive): you can use, modify, and distribute schemathesis freely in commercial and private projects with minimal restrictions.

Quickstart

pip install schemathesis

import schemathesis

schema = schemathesis.openapi.from_url("https://your-api.com/openapi.json")

@schema.parametrize()
def test_api(case):
    case.call_and_validate()

Verify before relying

  • Whether the package's stateful testing (as_state_machine) requires additional setup or configuration beyond the basic usage shown.
  • Performance characteristics when testing large or complex OpenAPI schemas with many endpoints.
  • Whether hypothesis-graphql and hypothesis-jsonschema are automatically invoked or require explicit configuration for GraphQL/JSON Schema support.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 15 — click, harfile, hypothesis-graphql, hypothesis-jsonschema, hypothesis, jsonschema-rs, pyrate-limiter, pytest, pyyaml, requests, rich, starlette-testclient, tomli, typing-extensions, werkzeug
Maintenance actively maintained — 20 days since the last release
Last repo commit
First released
Downloads 6,734,183/month — #1,862 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: schemathesis-4.24.3-py3-none-any.whl

Keywords: adaptive, fuzzing, graphql, hypothesis, openapi, pytest, testing

Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: HypothesisFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing

Tags

openapi api testinggraphql schema testingproperty-based api fuzzingautomated api validationhypothesis-based api testingstateful workflow testingschema compliance testing
api-testingproperty-based-testingschema-validation

More Testing packages