Powerful REST API Testing from the Command Line
RESTest is a flexible REST API testing tool written in Python that allows you to create, run and validate API tests through simple JSON files. Quickly set up test suites, validate responses, extract and reuse data between requests, and much more.
Discover RESTest in action — presented at PyCon Italy 2023 (in Italian)
Write tests using straightforward JSON syntax. No complex setup or configuration needed — just define your requests and expected results in simple, readable JSON files.
Automatic handling of cookies and authentication tokens across requests. Built-in support for Bearer token authentication keeps your test flows seamless.
Extract data from responses and store them as variables. Reuse extracted values in subsequent requests to build powerful, chained test scenarios.
Extract and validate nested JSON values with ease using the built-in path parser. Navigate deep into response structures with a simple, intuitive syntax.
Group tests into logical sections and chain them together. Build comprehensive test suites that validate complete API workflows from start to finish.
Generate Postman collections from your tests for team sharing. Detailed logging keeps track of all requests, responses, timing, and performance metrics.
Install via pip in seconds
pip install restest
Define your API endpoints, methods, and expected results in a simple JSON file
Execute your test suite from the command line
restest test.json
Get detailed output with pass/fail status, response times, and comprehensive logs
{
"system": {
"base_url": "https://api.example.com",
"log_file": "./restest.log"
},
"actions": [
{
"method": "get",
"url": "/users/1",
"tests": [
{
"field": "id",
"value": 1
}
]
}
]
}
RESTest is an open-source project released under the GPLv3 License. The community is welcome to contribute, report issues, and help shape the future of API testing.
Show your support by starring the repository and help others discover RESTest.
Found a bug or have a suggestion? Open an issue on GitHub and help improve the tool.
Contribute code, fix bugs, or add new features. Pull requests are always welcome.
Comprehensive docs covering everything from getting started to advanced features and path parsing.
Stop writing complex test scripts. RESTest makes API testing simple, fast, and reliable with just a JSON file and a single command.