Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Codecov LintCheck Examples Build and Test Package 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scanapi-2.13.3.dev50.tar.gz (38.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scanapi-2.13.3.dev50-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file scanapi-2.13.3.dev50.tar.gz.

File metadata

  • Download URL: scanapi-2.13.3.dev50.tar.gz
  • Upload date:
  • Size: 38.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for scanapi-2.13.3.dev50.tar.gz
Algorithm Hash digest
SHA256 e571ddd58b2018810b7868b258eba272d064a1ef9a853a633b8f54e4b8bc1dd3
MD5 f56e2bcef5539439ad675164bdf5aa18
BLAKE2b-256 3a2d306b9563a7f3e8e1d035ce3427aaa921d95656b3470b7259dfec7f720d2f

See more details on using hashes here.

File details

Details for the file scanapi-2.13.3.dev50-py3-none-any.whl.

File metadata

  • Download URL: scanapi-2.13.3.dev50-py3-none-any.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for scanapi-2.13.3.dev50-py3-none-any.whl
Algorithm Hash digest
SHA256 d1c42c9eda8eaa56890a21d382c811afe0235fce1533aae9e63d8cb8cb27b68f
MD5 a476743d6665b5534ea0b95c99fb7335
BLAKE2b-256 04b6fbb7150b62cdb7e31ad72b9e17a08fd3117b6892566b52443dcefe68ace2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page