Getting Started
Quick StartSpecification
Basic Structure API Specification Keys Python Code Environment Variables Custom Variables Chaining Requests API Specification in Multiple Files RetryConfiguration
Command Line Interface - CLI Configuration File Hiding Sensitive Information Custom ReportQuick Start
Requirements
How to install
$ 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:
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: $ # 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.