RepositoryPython
scanapi

scanapi/scanapi

Automated Integration Testing and Live Documentation for your API

1.6kstars
144forks
4issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: python-package

#1 Repository of the month

1
TINIX TRENDING·Topic: integration-testing

#1 Repository of the month

1
TINIX TRENDING·Topic: pypi-packages

#1 Repository of the month

Codecov LintCheck Examples Downloads Per Month PyPI version Discord OpenSSF Scorecard

A library for your API that provides:

  • Automated Integration Testing
  • Automated Live Documentation

Given an API specification, written in YAML/JSON format, ScanAPI hits the specified endpoints, runs the test cases, and generates a detailed report of this execution - which can also be used as the API documentation itself.

With almost no Python knowledge, the user can define endpoints to be hit, the expected behavior for each response and will receive a full real-time diagnostic report of the API!

Contents

Quick Start

Requirements

How to install

$ pip install scanapi

Install with pipx (isolated CLI)

If pip install scanapi collides with the dependencies in your project's environment, install it with pipx instead. pipx gives ScanAPI its own virtual environment and still puts the scanapi command on your PATH:

$ pipx install scanapi

This is the recommended path when you want ScanAPI as a standalone CLI rather than a project dependency.

Basic Usage

You will need to write the API's specification and save it as a YAML or JSON file. For example:

endpoints:
  - name: scanapi-demo # The API's name of your API
    path: http://demo.scanapi.dev/api/v1 # The API's base url
    requests:
      - name: list_all_users # The name of the first request
        path: users/ # The path of the first request
        method: get # The HTTP method of the first request
        tests:
          - name: status_code_is_200 # The name of the first test for this request
            assert: ${{ response.status_code == 200 }} # The assertion

And run the scanapi command

$ scanapi run <file_path>

Then, the lib will hit the specified endpoints and generate a scanapi-report.html file with the report results.

An overview screenshot of the report. A screenshot of the report showing the request details.

Documentation

The full documentation is available at scanapi.dev

Tutorial

Get started with ScanAPI by following our step-by-step tutorial.

Examples

You can find complete examples at scanapi/examples!

This tutorial helps you to create integration tests for your REST API using ScanAPI

Watch the video

Dependency Management

ScanAPI aims to minimize dependency conflicts and ensure a smooth developer experience. Most dependencies are specified as compatible version ranges to allow flexibility and avoid unnecessary conflicts. However, a few dependencies are strictly pinned for stability:

  • MarkupSafe==3.0.3: Pinned to the latest version for security and compatibility. Relax if future versions are verified safe.
  • pytest-freezegun==0.4.2: This package is unmaintained and only 0.4.2 is available. Strict pin is required for test stability.
  • requests-mock==1.12.1: Pinned to the latest version for compatibility. Relax if future versions are verified safe.

All other dependencies use safe version ranges (e.g., >=X.Y,<X+1.0) to reduce the likelihood of dependency conflicts. If you encounter issues with dependency installation, please open an issue or PR.

Dependency updates are regularly reviewed to ensure compatibility with supported Python versions and CI stability.

Contributing

Collaboration is super welcome! Check out our contribution guide to get started. Every little bit of help counts! Feel free to create new GitHub issues and interact here.

Let's build it together 🚀🚀

❤️ Contributors

contributors

Made with contrib.rocks.

Supporters Through Time

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
fastapi/fastapi

FastAPI framework, high performance, easy to learn, fast to code, ready for production

105.2k
Dec 3, 2026
RepositoryPython
postmanlabs/httpbin

HTTP Request & Response Service, written in Python + Flask.

13.6k
Nov 16, 2026
RepositoryPython
public-apis/public-apis

A collective list of free APIs

502.8k
Dec 2, 2026
Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Oct 31, 2026
RepositoryTypeScript
hoppscotch/hoppscotch

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

81.0k
Nov 30, 2026
RepositoryTypeScript
AykutSarac/jsoncrack.com

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

44.7k
Nov 25, 2026
RepositoryTypeScript
Kong/insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.

40.2k
Nov 27, 2026
RepositoryTypeScript
hasura/graphql-engine

Blazing fast, instant realtime GraphQL APIs on all your data with fine grained access control, also trigger webhooks on database events.

32.1k
Dec 1, 2026
RepositoryJava
OpenAPITools/openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)

26.9k
Nov 27, 2026