Analytics
Get project usage
Returns daily usage data for a specific project, broken down by region.
Feature flag: project-analytics
This endpoint is currently under a feature flag and available only to select testers. It may change or be removed before general availability.
At a glance
| Item | Value |
|---|---|
| Method | GET |
| Path | /v1/projects/{project_id}/usage |
| Auth | Authorization: Bearer <token-or-api-key> |
Quick request
Use this as a starting point. Replace the placeholder IDs and set PGBEAM_TOKEN if the endpoint requires auth.
curl -X GET \
"$PGBEAM_API_URL/v1/projects/<project_id>/usage" \
-H "Authorization: Bearer $PGBEAM_TOKEN"AuthorizationBearer <token>
JWT issued by Better Auth. Verified via JWKS.
In: header
Path Parameters
project_id*string
Unique project identifier (prefixed, e.g. prj_xxx).
Match
^[a-zA-Z0-9_.-]+$Query Parameters
start_date*string
Start date (inclusive, YYYY-MM-DD).
Format
dateend_date*string
End date (inclusive, YYYY-MM-DD).
Format
dateResponse Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://api.pgbeam.com/v1/projects/string/usage?start_date=2019-08-24&end_date=2019-08-24"{
"usage": [
{
"day": "2019-08-24",
"region": "string",
"queries_total": 0,
"cache_hits": 0,
"cache_misses": 0,
"connection_seconds": 0,
"bytes_transferred": 0
}
]
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}