Stats API
Read your numbers with an API key.
Get a key
Sign in, open Account and create an API key. The key is shown once, so copy it then. Gaugemint stores only a hash of it. A key can read the sites of the account that created it.
Choose Read-only for anything that only shows numbers, such as a dashboard or an admin page. A read-only key can call the stats endpoints on this page and nothing else, and you can limit it to some of your sites. Keep the key on your server, never in code that runs in a browser.
Send the key as a bearer token. The examples below use $GAUGEMINT_API_KEY as a placeholder (a shell variable holding your key).
Totals
curl -H "Authorization: Bearer $GAUGEMINT_API_KEY" \
"https://guagemint.com/api/v1/stats/aggregate?site_id=yourdomain.com&period=30d&metrics=visitors,pageviews,bounce_rate"
{"results":{"visitors":{"value":1284},"pageviews":{"value":3902},"bounce_rate":{"value":58}}}
The numbers above are examples. Metrics are visitors, visits, pageviews, bounce_rate and visit_duration (seconds).
Day by day
curl -H "Authorization: Bearer $GAUGEMINT_API_KEY" \
"https://guagemint.com/api/v1/stats/timeseries?site_id=yourdomain.com&period=7d&metrics=visitors"
Breakdowns
Group a metric by page, source, country or device with property.
curl -H "Authorization: Bearer $GAUGEMINT_API_KEY" \
"https://guagemint.com/api/v1/stats/breakdown?site_id=yourdomain.com&property=visit:source&metrics=visitors"
{"results":[{"source":"Google","visitors":1}]}
| property | Groups by |
|---|---|
event:page | Page path |
visit:source | Referrer source or campaign source |
visit:country | Country code |
visit:device | Device type |
visit:browser, visit:os | Browser, operating system |
Periods
period is day, 7d or 30d (the default). For a custom range use period=custom&date=2026-11-01,2026-11-15. History is kept for 90 days, so longer ranges only return what is stored.
Send events from your server or app
POST /api/event takes a JSON body and answers 202. Browsers use it through the script, and servers and mobile apps can call it directly.
curl -X POST https://guagemint.com/api/event \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.com","name":"Purchase","url":"https://yourdomain.com/thanks"}'
| Field | Notes |
|---|---|
domain | Required. A site you added to your account. |
name | Required. pageview or a custom event name. |
url, referrer | Optional. Query strings and fragments are dropped before storage. |
props | Optional. Flat object of values. |
revenue | Optional. {"amount": 29.99, "currency": "USD"} |
Visitors are told apart by the address and user agent a request arrives from. Events posted from your server therefore look like one visitor. For visitor counts, use the script in the browser, and use this endpoint for server-side events such as a completed purchase. For your own mobile apps, use product mode with an install id instead (Apps docs); on a site in web mode, devices are told apart by address and user agent only within one day.
Events over your plan's monthly limit are dropped and the endpoint still answers 202.