// ONE POST, ONE CHART

Send a metric with curl. Get a live chart.

One HTTPS POST records a counter or a value, EzStat draws the chart, and the data exports to CSV or JSON whenever you want it. No agent, no SDK, no collector to run: if it can make an HTTP request, it can report a metric.

Free: 10 stats, 300,000 datapoints a month, no card, open to the first 250 accounts. Paid plans are $19, $49 or $99 a month, and every paid plan tracks 10,000 stats — you choose by monthly datapoints and the history you can see and export (30 days on Free and Indie, 1 year on Pro, 3 years on Scale). Prices are flat and monthly, in USD, + tax where applicable. /pricing is the source of truth.

Before the first command

Create an account and copy your API key (it is shown once). The key works at once, with one stat and 500 datapoints a day until you confirm your email address; confirm within 7 days to keep sending. The examples on this page write several stats, so confirm before you run them all. Put the key in the environment:

export EZSTAT_API_KEY="your-api-key"

Count something

A counter is a running total: signups, orders, jobs finished. The stat is created by this first write.

export EZSTAT_API_KEY="your-api-key"   # from your EzStat dashboard; shown once

curl -fsS -X POST https://api.ezstat.dev/api/v1/stats/signups/count \
  -H "Authorization: Bearer $EZSTAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"count": 1}'

Expected response: HTTP 200 and {"status":"ok"}.

Record a value

A gauge is a measurement at a moment in time: response time, queue depth, rows imported. One stat is either a counter or a gauge, never both, so stay with /count or /value for each stat.

curl -fsS -X POST https://api.ezstat.dev/api/v1/stats/response_time/value \
  -H "Authorization: Bearer $EZSTAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value": 142}'

Know it worked

The v1 routes answer with real status codes: 200 with {"status":"ok"} when the point is stored, 401 for a bad key, 403 for a plan limit on stats or datapoints, 429 when rate limited (or when you reach the starting limit before confirming your email), 400 for malformed input. curl -f turns any of those into a non-zero exit, so a shell script can branch on it.

Do not fail your script because of a metric

Give the call a timeout and let it fail without taking the job down with it:

# A metric must never take your script down: timeout, and ignore the failure.
curl -fsS -m 10 -X POST https://api.ezstat.dev/api/v1/stats/signups/count \
  -H "Authorization: Bearer $EZSTAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"count": 1}' || echo "ezstat: could not record signups" >&2

A timeout is not a rejection: the point may already have been stored. If you retry, send the same explicit timestamp and ikey on every attempt — de-duplication keys on stat + timestamp + ikey, so the retry is stored once instead of twice. An ikey alone is not enough: without a timestamp each attempt is stamped on arrival.

# Retry-safe: the SAME timestamp + ikey on every attempt for one logical event.
curl -fsS -m 10 -X POST https://api.ezstat.dev/api/v1/stats/orders/count \
  -H "Authorization: Bearer $EZSTAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"count": 1, "timestamp": "2026-12-03T09:15:00Z", "ikey": "order-9831"}'

The timestamp is a date string or epoch milliseconds (not StatHat's t seconds), and the ikey is at most 128 printable ASCII characters. Full rules: /docs#replay-semantics.

Other languages, in short

The same two calls in Ruby and PHP — standard library only, no package to install.

require "json"
require "net/http"
require "uri"

def track(stat, kind, body)
  uri = URI("https://api.ezstat.dev/api/v1/stats/#{URI.encode_www_form_component(stat)}/#{kind}")
  req = Net::HTTP::Post.new(uri, "Content-Type" => "application/json",
                                 "Authorization" => "Bearer #{ENV['EZSTAT_API_KEY']}")
  req.body = body.to_json
  res = Net::HTTP.start(uri.host, uri.port, use_ssl: true, open_timeout: 5, read_timeout: 5) { |http| http.request(req) }
  raise "EzStat rejected the point: HTTP #{res.code}" unless res.is_a?(Net::HTTPSuccess)
end

track("signups", "count", { count: 1 })
track("checkout_ms", "value", { value: 142 })
<?php
function ezstat_track(string $stat, string $kind, array $body): void {
    $ch = curl_init("https://api.ezstat.dev/api/v1/stats/" . rawurlencode($stat) . "/" . $kind);
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_HTTPHEADER     => [
            "Authorization: Bearer " . getenv("EZSTAT_API_KEY"),
            "Content-Type: application/json",
        ],
        CURLOPT_POSTFIELDS     => json_encode($body),
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 5,
    ]);
    curl_exec($ch);
    $code = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
    curl_close($ch);
    if ($code !== 200) {
        error_log("EzStat rejected or missed the point: HTTP $code");
    }
}

ezstat_track("signups", "count", ["count" => 1]);
ezstat_track("checkout_ms", "value", ["value" => 142]);

Longer, production-shaped versions: Python, Node.js, Go.

What it costs

A stat is one named metric, so one cron job often uses two or three (a success count, a failure count, a duration). Free: 10 stats, 300,000 datapoints a month, no card, open to the first 250 accounts. Paid plans are $19, $49 or $99 a month and every paid plan tracks 10,000 stats; the history you can see and export is 30 days on Free and Indie, 1 year on Pro, 3 years on Scale. See the full table.

What this is not

There is no anonymous write: every call carries your key. It is not APM, logs or traces, it is not the StatsD wire protocol (see /statsd), and a stat has no tags — put the dimension in the name, such as checkout_eu.

Questions

How do I send a metric with curl?

POST JSON to https://api.ezstat.dev/api/v1/stats/{name}/count for a counter, or /value for a gauge, with your key in an Authorization: Bearer header. EzStat creates the stat on the first request, draws a chart for it, and answers HTTP 200 with {"status":"ok"} once the point is stored. There is no agent or SDK to install.

Can I post a metric without an API key?

No. Every write needs your account's API key, so nobody else can add points to your charts. Create an account and copy your key; it is shown once. The key works at once, with one stat and 500 datapoints a day until you confirm your email address. Confirm within 7 days to keep sending.

How do I avoid double-counting when a metric request times out?

A timeout leaves the outcome unknown, because the point may have been stored after your client gave up. EzStat de-duplicates a retry only when every attempt carries the same explicit timestamp and the same idempotency key (ikey). Without a fixed timestamp each attempt is stamped on arrival and is stored again.

How do I know a write succeeded?

A stored point returns HTTP 200 with {"status":"ok"}. A bad key returns 401, a plan limit on stats or datapoints returns 403, rate limiting returns 429 and malformed input returns 400. An account that has not confirmed its email gets a 429 when it reaches its starting limit. Add -f to curl so a rejection becomes a non-zero exit code.

What does a stat count against my plan?

A stat is one named metric, such as signups or response_time. Free: 10 stats, 300,000 datapoints a month, no card, open to the first 250 accounts. Every paid plan allows 10,000 stats. Paid plans add more datapoints a month, and Pro and Scale add longer history.

Where to go next

Chart a scheduled job on /cron-metrics, count deploys on /github-actions-metrics, or compare with a full observability suite on /datadog-alternative. Coming from StatHat? The migration guide keeps your existing calls working. If an agent does the recording instead of a script, /ai-agent-metrics has the same calls as MCP tools.