Diagnostic tool for HTTP API issues. Captures or runs a request, runs a battery of checks, produces a structured report with plain-language findings.
Project description
api-medic
A diagnostic tool for HTTP API issues. Paste a curl, upload a HAR, or fire a live request — get a structured report with plain-language findings across DNS, TLS, redirects, CORS, auth, body, and rate limiting.
Try it now
api-medic.markandrewmarquez.com — no install. The Demos tab has eight pre-built scenarios; the Run tab fires a live request from the browser (HTTPS-only, SSRF-guarded, throttled); the HAR tab takes any HAR export from DevTools.
What gets checked
19 diagnostic checks across five categories. IDs are stable and namespaced so you can filter, suppress, or reference individual findings without coupling to the human-readable title.
| Category | Checks |
|---|---|
| Network & transport (6) | network.dns.no_records, network.dns.slow, network.tls.expired, network.tls.expiring_soon, network.tls.weak_protocol, network.tls.cn_mismatch |
| HTTP semantics (4) | http.cors.misconfigured, http.headers.duplicate, http.redirect.loop, http.redirect.protocol_downgrade |
| Auth (4) | auth.missing, auth.jwt.expired, auth.jwt.not_yet_valid, auth.header.whitespace |
| Body / content (3) | body.malformed_json, body.content_length_mismatch, body.encoding_mismatch |
| Rate limiting (2) | rate_limit.hit (429 + Retry-After context), rate_limit.approaching (X-RateLimit-Remaining < 10% of limit) |
JWT signatures aren't verified — claims are decoded for exp / nbf checks only. Signature verification needs the issuer's secret/public key, which is out of scope for a client-side diagnostic.
See docs/architecture.md for the full check spec, evidence shape, and design rationale per check.
Install
pip install api-medic
Requires Python 3.10+. The wheel includes the local web UI bundle — no separate frontend install.
Quickstart
# Bare URL — shorthand for `api-medic run`
api-medic https://api.example.com/v1/users
# Full request: method, headers, body
api-medic run https://api.example.com/v1/users \
--method POST \
--header "Authorization: Bearer ..." \
--header "Content-Type: application/json" \
--body '{"name": "Alex Doe"}'
# Analyze a curl command (defaults to executing it)
api-medic from-curl 'curl -X GET https://api.example.com/v1/users -H "Authorization: Bearer ..."'
# Analyze a captured HAR file (no execution)
api-medic from-har session.har
# Launch the local web UI on http://localhost:8765
api-medic serve
Output flags: --output {terminal,json,markdown,html} (default terminal), --save <path>, --no-color, --verbose.
Surfaces
Four ways to use it, all powered by the same core engine — every surface produces a byte-identical Report given the same input.
┌────────┐ ┌──────────────┐ ┌─────────────┐ ┌─────────────────┐
│ CLI │ │ Local web UI │ │ Hosted demo │ │ Browser ext │
└───┬────┘ └──────┬───────┘ └──────┬──────┘ └────────┬────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌────────────────────────────────────────────────────────────────┐
│ api_medic.core.engine │
│ parser · runner (httpx + dnspython + cryptography) · │
│ 19 checks · renderers (terminal · json · markdown · html) │
└────────────────────────────────────────────────────────────────┘
│
▼
Pydantic Report
- CLI —
pip install api-medic, full feature set, four output formats. - Local web UI —
api-medic serveruns the same engine behind a browser frontend athttp://localhost:8765. No outbound calls except to the target you're diagnosing. - Hosted demo — api-medic.markandrewmarquez.com. Captured (HAR/curl) and live-run modes. Live runs are HTTPS-only, SSRF-guarded, and throttled (2 req/sec, burst 5). Stateless — no payload is persisted; see
PRIVACY.md. - Browser extension — Chrome / Firefox MV3 DevTools panel that captures requests in-browser and posts them to the hosted analyzer. See
extension/README.mdfor source-install instructions.
Architecture
A pure-Python core engine (parser + runner + 19 checks + four renderers) wrapped by four surfaces. The Lambda surface ships the runner alongside an SSRF guard for live requests; FastAPI / uvicorn are excluded so the cold-start budget stays intact even with httpx, dnspython, and cryptography shipped. The browser extension is a thin capture layer — analysis runs server-side on the hosted Lambda, which is why the same Report component renders identically in the panel and on the hosted demo.
See docs/architecture.md for the full v1 spec, including the Pydantic data model, per-check rationale, and AWS deployment topology.
Contributing
Issues and PRs welcome at github.com/marky224/api-medic. Quality gates enforced in CI: pytest, ruff check . && ruff format --check ., mypy, and make types to keep the TypeScript types in sync with the Pydantic models.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file api_medic-1.1.0.tar.gz.
File metadata
- Download URL: api_medic-1.1.0.tar.gz
- Upload date:
- Size: 7.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ba676525091145adaa4c44851de5f8c05e0d0e3f3a47ccb342f25ab3690f215
|
|
| MD5 |
cd7546509f2ab6578c1958665379e4e0
|
|
| BLAKE2b-256 |
37b01ca70cb95b094e0448708b108e9135bd0f075254c1989fb9cf0b6b416dc5
|
Provenance
The following attestation bundles were made for api_medic-1.1.0.tar.gz:
Publisher:
publish-pypi.yml on marky224/api-medic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
api_medic-1.1.0.tar.gz -
Subject digest:
9ba676525091145adaa4c44851de5f8c05e0d0e3f3a47ccb342f25ab3690f215 - Sigstore transparency entry: 1424018378
- Sigstore integration time:
-
Permalink:
marky224/api-medic@0f86ef978d2861069aa026f96c5b3bc8cfd05de0 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/marky224
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0f86ef978d2861069aa026f96c5b3bc8cfd05de0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file api_medic-1.1.0-py3-none-any.whl.
File metadata
- Download URL: api_medic-1.1.0-py3-none-any.whl
- Upload date:
- Size: 110.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34d1f07f832e1b11fd874928d7e23001550dca5b862607d7ff9ddd710f3f6f8d
|
|
| MD5 |
9126870fe4b1b7cd6cdb6068e9a161c8
|
|
| BLAKE2b-256 |
e49029875fac5ff20cf2a1a72ef29903497d6db0fefce86d93ec8583e23682d6
|
Provenance
The following attestation bundles were made for api_medic-1.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on marky224/api-medic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
api_medic-1.1.0-py3-none-any.whl -
Subject digest:
34d1f07f832e1b11fd874928d7e23001550dca5b862607d7ff9ddd710f3f6f8d - Sigstore transparency entry: 1424018551
- Sigstore integration time:
-
Permalink:
marky224/api-medic@0f86ef978d2861069aa026f96c5b3bc8cfd05de0 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/marky224
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0f86ef978d2861069aa026f96c5b3bc8cfd05de0 -
Trigger Event:
push
-
Statement type: