Get the database metrics history
Changed onReturns up to 288 points (24h sampled every 5 minutes) of CPU, RAM, network, disk I/O and storage usage for the database, newest first. On Pro and Enterprise plans, range=7d returns up to 168 hourly points (7 days) with the hour's average (cpu, ram) and peak (cpu_max, ram_max); other plans get the 24h answer instead. Cached for 2.5 minutes per (user, database), 10 minutes for 7d.
Each point: cpu (% of the plan's CPU), ram (MB), net = [bytes received, bytes sent] and disk = [bytes read, bytes written], both cumulative since the container started (a value lower than the previous point means it restarted; disk is null on a point without a reading), and storage = bytes the container's disk holds (null without a reading).
Rate limited to 10 requests per 5s per user, with a 60s block on the cap.
Request
- Base URLhttps://api.squarecloud.app
- AuthAPI key in header Authorization
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Database identifier.
Query parameters
24h (default): one point every 5 minutes (every 10 minutes for applications below 512 MB). 7d: one point per hour with the hour's average and peak, on Pro and Enterprise plans; other plans and applications below 512 MB get the last 24 hours instead of an error.
Response
Array of metric points, newest first. Empty when the database has no recent data.
Changes
- warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status
- warning
- info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status
- info