Query Insights API endpoints
Query Insights data is now available through the public PlanetScale API. New endpoints let you programmatically access everything you see in the Insights dashboard:
- Query statistics — list branch queries with performance metrics, retrieve per-fingerprint statistics and summaries
- Query errors — list error summaries and the failed queries behind each error fingerprint
- Anomalies — list detected performance anomalies and their correlated queries
- Query tags — list tags on your queries, and group query statistics by tag
- Traffic budgets — list the traffic budgets affecting a query fingerprint (Postgres)
To use these with a service token, grant your token read_database permission.