https://github.com/scanapi/scanapi
Automated Integration Testing and Live Documentation for your API
https://github.com/scanapi/scanapi
api autodoc integration-testing json pypi-packages python-package python3 rest-api scanapi testing yaml
Last synced: 30 days ago
JSON representation
Automated Integration Testing and Live Documentation for your API
- Host: GitHub
- URL: https://github.com/scanapi/scanapi
- Owner: scanapi
- License: mit
- Created: 2019-07-20T10:31:47.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-01-13T03:27:21.000Z (4 months ago)
- Last Synced: 2025-04-10T02:15:05.837Z (30 days ago)
- Topics: api, autodoc, integration-testing, json, pypi-packages, python-package, python3, rest-api, scanapi, testing, yaml
- Language: Python
- Homepage: https://scanapi.dev
- Size: 2.33 MB
- Stars: 1,389
- Watchers: 24
- Forks: 84
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-made-by-brazilians - scanapi
README

A library for **your API** that provides:
- Automated Integration Testing
- Automated Live DocumentationGiven 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
- [Contents](#contents)
- [Requirements](#requirements)
- [How to install](#how-to-install)
- [Basic Usage](#basic-usage)
- [Documentation](#documentation)
- [Examples](#examples)
- [Contributing](#contributing)## Requirements
- [pip][pip-installation]
## How to install
```bash
$ pip install scanapi
```## Basic Usage
You will need to write the API's specification and save it as a **YAML** or **JSON** file.
For example:```yaml
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
```bash
$ scanapi run
```Then, the lib will hit the specified endpoints and generate a `scanapi-report.html` file with the report results.
![]()
![]()
## Documentation
The full documentation is available at [scanapi.dev][website]
## Examples
You can find complete examples at [scanapi/examples][scanapi-examples]!
This tutorial helps you to create integration tests for your REST API using ScanAPI
[](https://www.youtube.com/watch?v=JIo4sA8LHco&t=2s)
## Contributing
Collaboration is super welcome! We prepared the [Newcomers Guide][newcomers-guide] to help you in the first steps. Every little bit of help counts! Feel free to create new [GitHub issues][github-issues] and interact here.
Let's build it together 🚀🚀
[github-issues]: https://github.com/scanapi/scanapi/issues
[newcomers-guide]: https://github.com/scanapi/scanapi/wiki/Newcomers
[pip-installation]: https://pip.pypa.io/en/stable/installing/
[scanapi-examples]: https://github.com/scanapi/examples
[website]: https://scanapi.dev