Build Coverage Version Python versions Discord License

Schemathesis

Schemathesis automatically generates and runs API tests from your OpenAPI or GraphQL schema to find bugs and spec violations.

Schemathesis automatically finding a server error
Automatically finding specification violations and server errors

Note: This is the V4 branch under active development. While fully functional and passing tests, some features may be missing, and documentation is being updated. For the stable release, see the V3 branch.

Why Schemathesis?

Installation

# Using uv (recommended)
$ uv pip install schemathesis

# Using pip
$ pip install schemathesis

# Using Docker
$ docker pull schemathesis/schemathesis:stable

Usage

Command Line

# Run tests against a schema URL
$ st run https://example.schemathesis.io/openapi.json

Python Library

import schemathesis

schema = schemathesis.openapi.from_url("https://example.schemathesis.io/openapi.json")


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

CI/CD Integration

# GitHub Actions example
steps:
  - uses: schemathesis/action@v1
    with:
      schema: "https://example.schemathesis.io/openapi.json"

Documentation

📚 Read the full documentation for guides, examples, and reference material.

Who's Using Schemathesis?

Schemathesis is used by companies and open-source projects including:

Testimonials

"The world needs modern, spec-based API tests, so we can deliver APIs as-designed. Schemathesis is the right tool for that job."

Emmanuel Paraskakis - Level 250

"Schemathesis is the only sane way to thoroughly test an API."

Zdenek Nemec - superface.ai

"The tool is amazing as it can test negative scenarios instead of me and much faster!"

Luděk Nový - JetBrains

"Schemathesis is the best tool for fuzz testing of REST API on the market. We are at Red Hat use it for examining our applications in functional and integrations testing levels."

Dmitry Misharov - RedHat

"There are different levels of usability and documentation quality among these tools which have been reported, where Schemathesis clearly stands out among the most user-friendly and industry-strength tools."

Testing RESTful APIs: A Survey - a research paper by Golmohammadi, at al

Contributing

We welcome contributions! Your input directly influences Schemathesis development.

Get in Touch

Need assistance with integration or have specific questions? Contact us at support@schemathesis.io.

Acknowledgements

Schemathesis is built on top of Hypothesis, a powerful property-based testing library for Python.

License

This project is licensed under the terms of the MIT license.

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.