Automating Kinsta Hosting Reports with the Kinsta API
Use the Kinsta API v2 analytics endpoints to pull visits, bandwidth, CDN usage, top countries, and other metrics, then build automated client reports.
Implement calls to the Kinsta API v2 analytics endpoints, parse the JSON responses, and integrate the data into your reporting workflow.
Summary
Kinsta’s MyKinsta dashboard already exposes a wealth of analytics such as plan usage, top requests, cache, CDN bandwidth, dispersion, performance, response codes, geo, and IP data. The same data can be fetched programmatically via the Kinsta API v2 analytics endpoints, allowing agencies to pull visits, bandwidth, CDN usage, top countries, cities, client IPs, visit dispersion, and response code breakdowns for any environment. Each endpoint requires the environment ID, company ID, and a time_span query parameter (e.g., 30_days or 7_days) and returns a JSON payload with total values and daily datasets. By scripting calls to these endpoints and storing the results, teams can generate automated, client‑ready reports that track resource consumption, traffic sources, and performance trends without manual dashboard exports.
Key changes
- Visits endpoint returns total visits and unique IPs over the requested time_span
- Bandwidth endpoint returns daily server bandwidth usage for the period
- CDN bandwidth endpoint returns daily CDN bandwidth usage
- Top Countries endpoint returns a list of countries from which requests originate
- Top Cities endpoint returns a list of cities from which requests originate
- Top Client IPs endpoint returns a list of client IP addresses
- Visit Dispersion endpoint returns desktop/tablet/mobile distribution data
- Response Code Breakdown endpoint returns HTTP status code statistics