No install needed
The playground runs in this tab against a fake API. Hello sample, click Run, you get PASS.
User guide
SnapAPI is a small language for hitting APIs. You write a .sapi file, run snapapi, and get PASS or FAIL. A GET is enough to start. Tokens and setup can wait.
The playground runs in this tab against a fake API. Hello sample, click Run, you get PASS.
Quick start is that GET on your laptop, with a tiny mock server so you don’t need a public API.
POST, SAVE an id, tokens, helpers — then point URL: at your own origin.
Once a suite is green locally, drop snapapi in the pipeline. Reports and cassettes live under CI.
Most HTTP tests hide the request in helpers and fixtures. Here the file is the request.
Someone reviewing your PR should see the path, the body, and the checks without opening another file.
GET: /users and EXPECT: status == 200 are the whole test. POST and SAVE are the same kind of line.
You don’t need OpenAPI, a cassette, or a token to see PASS. Hello world is a GET against a local mock.
.sapi is plain text. It diffs and reviews like anything else in the repo.
If both sides can read HTTP, both sides can read the suite. That’s the point.
run_suitesSnapAPI isn’t designed to replace every API testing framework.
If your tests need complex programming logic, custom cryptography inside the suite, extensive Python fixtures, WebSockets, gRPC, or highly customized execution flows, keep your existing framework.
SnapAPI is for teams whose API tests mostly look like:
request → assert → extract → request → assert
If that’s 80% of your suite, SnapAPI makes that 80% easier to read, review, and maintain. The other 20% stays in Python — CALL from extensions/ for one ugly value, or pytest around the runner. The .sapi file still describes HTTP; Python does not leak into the test language. Not IF / FOR / WHILE in the file.
The longer version: When SnapAPI is not for you.
SUITE: Hello API
URL: mock://api
TEST: Get Users
GET: /users
EXPECT: status == 200
mock://api is the playground’s fake server. On your laptop, quick start uses snapapi mock instead. Don’t try api.example.com — that host isn’t ours.
No language server, no gRPC, no WebSockets. OpenAPI checks exist if you want them; they’re not a spec toolchain. The playground covers a useful chunk of the language. FILE, GRAPHQL, IMPORT, oauth2, schema, XPath, and CALL still need the CLI.