ReportsClient
The main client class for interacting with the Nebuly reports API.Constructor
Your Nebuly public API key. Must not be a secret key (starting with
sk-
).Number of retry attempts for failed requests.
Delay in milliseconds between retry attempts.
Base URL for the Nebuly API.
Whether to suppress errors when a secret key is used instead of a public key.
Whether to suppress console error logs when a secret key is used.
Methods
listReports()
Retrieves a list of all available reports.Array of report objects containing basic report information.
getReport(params)
Retrieves detailed data for a specific report.The unique identifier of the report to retrieve.
Optional time range filter for the report data.
Optional tags to filter the report data. Values can be strings or arrays of strings.
The report data containing charts and metadata.
Types
Report
Unique identifier for the report.
Display name of the report.
Description of the report.
ReportData
Unique identifier for the report.
Display name of the report.
Array of chart data objects within the report.
ChartData
Unique identifier for the chart (prefixed with “chart-”).
Display name of the chart.
Type of the chart.
Array of variable names used in the chart.
Type of visualization for the chart.
Display type for the chart.
Breakdown dimension for the chart data.
Time range for the chart data.
Time granularity for the chart data.
Array of x-axis label values.
Array of data points for the chart.
TimeRange
The type of time range (e.g., “custom”, “today”, “7_days”, etc.).
Start date/time for the range (ISO format).
End date/time for the range (ISO format).
TimeRangeKind
Available time range kinds:"custom"
- Custom date range"date_to_now"
- From a specific date to now"today"
- Today only"yesterday"
- Yesterday only"7_days"
- Last 7 days"30_days"
- Last 30 days"this_month"
- Current month"this_quarter"
- Current quarter"this_year"
- Current year"last_month"
- Previous month"last_quarter"
- Previous quarter"3_months"
- Last 3 months"6_months"
- Last 6 months"12_months"
- Last 12 months"3_months_full"
- Last 3 full months"6_months_full"
- Last 6 full months"12_months_full"
- Last 12 full months"q1"
- Q1"q2"
- Q2"q3"
- Q3"q4"
- Q4"ytd"
- Year to date
DatasetDatapoint
Label for the data point.
Array of coordinate data points with optional user information.
Error Handling
The client throwsInvalidUrlError
when an invalid base URL is provided during initialization.