Schemathesis
Schemathesis automatically generates and runs API tests from your OpenAPI or GraphQL schema to find bugs and spec violations.
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?
- 🔬 Research-backed testing: Validated in academic research and recognized in an ACM survey as a state-of-the-art API testing tool
- 🔍 Schema-Based Generation - Creates test cases directly from your API documentation
- 🛡️ Zero Configuration - Works immediately with any valid OpenAPI or GraphQL schema
- 🔄 Advanced Testing Techniques - Employs stateful testing, boundary analysis, and fuzzing
- 🧪 Continuous Testing - Integrates with CI/CD pipelines for automated verification
- ⚡ Extensive Coverage - Tests more scenarios than manual scenarios can reasonably cover
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:
- Netflix (Dispatch)
- Spotify (Backstage)
- WordPress (OpenVerse)
- Chronosphere.io (Calyptia)
- Qdrant
- Pixie
- CheckMK
- Weechat
- HXSecurity (DongTai)
- Abstract Machines (Magistrala)
- Bundesstelle für Open Data (smard-api)
Testimonials
"The world needs modern, spec-based API tests, so we can deliver APIs as-designed. Schemathesis is the right tool for that job."
"Schemathesis is the only sane way to thoroughly test an API."
"The tool is amazing as it can test negative scenarios instead of me and much faster!"
"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."
"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."
Contributing
We welcome contributions! Your input directly influences Schemathesis development.
- Discuss ideas in GitHub issues or our Discord server
- See our contributing guidelines for code contributions
- Share your experience using this feedback form
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.