Skip to main content

RESTest Documentation

RESTest is a powerful and flexible REST API testing tool written in Python that allows you to create, run and validate API tests through simple JSON files. With RESTest, you can quickly set up test suites for your APIs, validate responses, extract and reuse data between requests, and much more.

WATCH my PyCon IT 2023 presentation (in Italian)

Watch the video

Key Features

  • Simple JSON-based Test Definition: Write tests using straightforward JSON syntax
  • Session Management: Automatic handling of cookies and authentication tokens
  • Variable Storage and Reuse: Extract data from responses and use them in subsequent requests
  • Powerful Path Parser: Extract and validate nested JSON values with ease
  • Request Authentication: Built-in support for Bearer token authentication
  • Comprehensive Testing: Validate response status codes, headers, and body content
  • Test Organization: Group tests into logical sections
  • Test Chaining: Use data from previous responses in subsequent requests
  • Export Capabilities: Generate Postman collections from your tests
  • Detailed Logging: Keep track of all requests and responses
  • Performance Metrics: Monitor request timing and response sizes

Quick Start

Installation

Install RESTest using pip:

pip install restest

Basic Usage

Create a simple test file (e.g., test.json):

{
  "system": {
    "base_url": "https://api.example.com",
    "log_file": "./restest.log"
  },
  "actions": [
    {
      "method": "get",
      "url": "/users/1",
      "tests": [
        {
          "field": "id",
          "value": 1
        }
      ]
    }
  ]
}

Run the test:

restest test.json

Documentation Chapters

  1. Getting Started

  2. Test Structure

  3. Making Requests

  4. Testing Responses

  5. Variables and Data

  6. Advanced Features

  7. Integration and Export

  8. Command Line Options

APPENDIX A - Test Modes Reference

APPENDIX B - Path Parser

Contributing

RESTest is an open-source project and welcomes contributions. Visit the GitHub repository to:

  • Report issues
  • Submit pull requests
  • Suggest new features
  • Help improve documentation

License

RESTest is released under the GPLv3 License. See the LICENSE file in the project repository for more details.

Metadata

Release files for restest 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for restest 2.5.0
File Interpreter ABI Platform
restest-2.5.0-py3-none-any.whl Python 3 none any Details

Release files / restest-2.5.0-py3-none-any.whl

Download URL restest-2.5.0-py3-none-any.whl
Size 37.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8543dfa4fe6cb6d548032eaa3f4dd0b9f40d48ddabda0dcfe03f7bfe15e9a89c
BLAKE2b-256 checksum
How to use checksums
5387ce6ea2ebb9c9eaaf5cd0398b809b6498f6fd7c84f54877fb1a40ef637cee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

2.5.0 This release

1 release file

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page