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. Capture or run a request, get a structured report with plain-language findings — DNS, TLS, auth, CORS, rate limiting, body/encoding, redirects, the lot.
Built primarily for technical support engineers triaging customer-reported API issues, but useful for anyone debugging an HTTP integration.
Try it now (no install)
api-medic.markandrewmarquez.com — paste a curl command, upload a HAR, or fire a live request from the browser. Live runs are HTTPS-only and throttled; captured-mode (curl/HAR) accepts anything.
Install
pip install api-medic
Requires Python 3.10+.
Quickstart
# Quickest possible diagnosis
api-medic https://api.example.com/v1/users
# Full request with 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 without re-running it
api-medic from-curl 'curl -X POST https://api.example.com/v1/users -H "Authorization: Bearer ..." -d ''{"name": "Alex Doe"}'''
# Analyze a HAR file (export from browser DevTools → Network → Save HAR)
api-medic from-har session.har
# Launch the local web UI on http://localhost:8765
api-medic serve
Output formats: --output {terminal,json,markdown,html}, default terminal.
What gets checked
Twenty-plus diagnostic checks across:
- Network: DNS resolution, no records, address-class issues
- TLS: cert expiry, hostname mismatch, expiring soon, weak protocol
- Transport: redirect loops, redirect-to-http, slow TLS handshake
- Auth: JWT expiry, missing/malformed Authorization, suspicious signature
- CORS: preflight failures, origin not allowed, credentials misconfigured
- Body: malformed JSON, Content-Length mismatch, Content-Encoding mismatch
- Rate limiting: 429 with Retry-After surfaced as a finding
- Status: 4xx/5xx routing, server errors with body context
Every check produces the same Report shape — same fields, same JSON schema — whether it ran in the CLI, local web UI, or hosted demo. See docs/architecture.md for the full check list and data model.
Architecture
Three input surfaces, one core engine:
- CLI (
api-medic ...): full feature set, terminal/JSON/MD/HTML output - Local web UI (
api-medic serve): same engine, browser frontend - Hosted demo (
api-medic.markandrewmarquez.com): captured + live, SSRF-guarded, throttled
Shared Report shape across all three surfaces — a CLI report and a hosted-demo report are byte-identical given the same input.
Contributing
Issues and PRs welcome at github.com/marky224/api-medic. See docs/architecture.md for the design rationale before proposing larger changes.
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.0.0.tar.gz.
File metadata
- Download URL: api_medic-1.0.0.tar.gz
- Upload date:
- Size: 6.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
219af71d57bfcad466208149c60988395073346074ee4f611bb8ce6c32543c07
|
|
| MD5 |
259d7bf6ec4aa906fe30b5b030b4e20f
|
|
| BLAKE2b-256 |
deadf0c29ec817b5be22a9c8f14df8faa1df903161288e4ce2c776458bbf6df6
|
Provenance
The following attestation bundles were made for api_medic-1.0.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.0.0.tar.gz -
Subject digest:
219af71d57bfcad466208149c60988395073346074ee4f611bb8ce6c32543c07 - Sigstore transparency entry: 1399078042
- Sigstore integration time:
-
Permalink:
marky224/api-medic@fe5611344be1310f49f97d1082e49347a27e1b3a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/marky224
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@fe5611344be1310f49f97d1082e49347a27e1b3a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file api_medic-1.0.0-py3-none-any.whl.
File metadata
- Download URL: api_medic-1.0.0-py3-none-any.whl
- Upload date:
- Size: 106.2 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 |
202d0aa1243ccace7cf15f98808ae61514128f0a511cf6d4662863eec29ab1be
|
|
| MD5 |
3bc121ac5b0911947f911a33a407d6a5
|
|
| BLAKE2b-256 |
494548234e00d99dbd0734952b5db2c29d14d05b60bd09235dcfe9a2e03fb393
|
Provenance
The following attestation bundles were made for api_medic-1.0.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.0.0-py3-none-any.whl -
Subject digest:
202d0aa1243ccace7cf15f98808ae61514128f0a511cf6d4662863eec29ab1be - Sigstore transparency entry: 1399078046
- Sigstore integration time:
-
Permalink:
marky224/api-medic@fe5611344be1310f49f97d1082e49347a27e1b3a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/marky224
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@fe5611344be1310f49f97d1082e49347a27e1b3a -
Trigger Event:
workflow_dispatch
-
Statement type: