PgBeam Docs
Analytics

getProjectInsights

Get query insights for a project

Returns aggregated query-level analytics for a project including top queries by count, cache hit/miss summary, and latency statistics.

Usage

const result = await api.analytics.getProjectInsights({
    pathParams: { project_id: "prj_xxx" },
  });

Parameters

ParameterTypeRequiredDescription
pathParams.project_idstringYesUnique project identifier (prefixed, e.g. prj_xxx).
queryParams.range"1h" | "6h" | "24h" | "7d"NoTime range to query. Defaults to 24h.
queryParams.limitnumberNoMaximum number of top queries to return (1-100).

Response

Promise<ProjectInsights> — query insights for the project.

Example

import { PgBeamClient } from "pgbeam";

const client = new PgBeamClient({
  token: "pbk_...",
  baseUrl: "https://api.pgbeam.com",
});

const result = await client.api.analytics.getProjectInsights({
  pathParams: { project_id: "prj_xxx" },
  queryParams: { range: "...", limit: 20 },
});

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
404Resource not found.
429Rate limited. Try again later.

On this page