reorx /httpstat

curl statistics made simple

★ 6,220⑂ 384
PythonCreated 2016-08-30
6,220
stars
+-1+-1+3
384
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions

README

httpstat

!screenshot

httpstat visualizes curl(1) statistics in a way of beauty and clarity.

It is a single file🌟 Python script that has no dependency👏 and is compatible with Python 3🍻.

 Features

- Beautiful terminal output — timing breakdown of DNS, TCP, TLS, server processing, and content transfer
- Structured JSON output — --format json / jsonl for machine consumption with a stable v1 schema
- SLO threshold checking — --slo total=500,connect=100 exits with code 4 on violation
- Save results to file — --save path.json for multi-step workflows
- NO_COLOR support — respects the NO_COLOR convention
- Agent skill — built-in skill for agent-assisted HTTP performance diagnostics


 Installation

There are three ways to get httpstat:

- Download the script directly: wget https://raw.githubusercontent.com/reorx/httpstat/master/httpstat.py

- Through pip: pip install httpstat

- Through homebrew (macOS only): brew install httpstat

 For Windows users, @davecheney's Go version is suggested. → download link

 Skills

httpstat ships with an agent skill that teaches AI coding assistants (Claude Code, Cursor, etc.) how to use httpstat for HTTP performance diagnostics — automatic installation, bottleneck identification, and actionable fix suggestions.

Install the skill into your project:

bash
npx skills add reorx/httpstat


Once installed, your agent will automatically use httpstat when you ask questions like "why is this API slow?" or "debug this endpoint's latency".

 Usage

Simply:

bash
python httpstat.py httpbin.org/get


If installed through pip or brew, you can use httpstat as a command:

bash
httpstat httpbin.org/get


 cURL Options

Because httpstat is a wrapper of cURL, you can pass any cURL supported option after the url (except for -w, -D, -o, -s, -S which are already used by httpstat):

bash
httpstat httpbin.org/post -X POST --data-urlencode "a=b" -v


 Structured Output

Use --format (-f) to get machine-readable output:

bash
httpstat httpbin.org/get --format json


json
{
  "schema_version": 1,
  "url": "httpbin.org/get",
  "ok": true,
  "exit_code": 0,
  "response": {
    "status_line": "HTTP/2 200",
    "status_code": 200,
    "remote_ip": "...",
    "remote_port": "443",
    "headers": {"Content-Type": "application/json", "Server": "nginx", "...": "..."}
  },
  "timings_ms": {
    "dns": 5, "connect": 10, "tls": 15,
    "server": 50, "transfer": 20, "total": 100,
    "namelookup": 5, "initial_connect": 15,
    "pretransfer": 30, "starttransfer": 80
  },
  "speed": { "download_kbs": 1234.5, "upload_kbs": 0.0 },
  "slo": null
}


Use --format jsonl for compact single-line JSON (useful for log pipelines).

 SLO Thresholds

Check response times against thresholds. Exits with code 4 on violation:

bash
httpstat httpbin.org/get --slo total=500,connect=100,ttfb=200


Supported keys: total, connect, ttfb (time to first byte), dns, tls.

In pretty mode, violations are printed in red at the end of the output.
In JSON mode, violations appear in t

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON