Skip to content

Reports

client.report() and client.report_url() call these functions. See the reports guide.

report

report(client: T3Client, endpoint: str, *, licenses: LicenseArg = None, format: str | None = None, to: str | Path | None = None, columns: str | Sequence[str] | None = None, filter: str | Sequence[str] | None = None, filter_logic: str | None = None, sort: str | None = None, row_limit: int | None = None, delivery: str | None = None, email: str | None = None, params: Mapping[str, Any] | None = None) -> Any

Download a report.

Parameters:

Name Type Description Default
endpoint str

A report's endpoint ID (ITEMS_REPORT) or path.

required
licenses LicenseArg

Up to 20 licenses. Defaults to the client's license.

None
format str | None

json, csv, xlsx or googleSheets. Defaults to the extension of to, else csv.

None
to str | Path | None

Stream the report to this file and return its path.

None
columns str | Sequence[str] | None

Columns to include, in order.

None
filter str | Sequence[str] | None

field__op:value filters, as in T3Client.collect.

None
filter_logic str | None

"and" or "or", as in T3Client.collect.

None
sort str | None

field:asc or field:desc.

None
row_limit int | None

Stop after this many rows.

None
delivery str | None

"email" asks the server to email the report to email.

None
params Mapping[str, Any] | None

Any other query parameters, by their spec names.

None

Returns:

Type Description
Any

The file path with to=; parsed JSON for format="json" or email

Any

delivery; the sheet URL for googleSheets; otherwise bytes.

report_url

report_url(client: T3Client, endpoint: str, *, licenses: LicenseArg = None, format: str = 'csv', columns: str | Sequence[str] | None = None, filter: str | Sequence[str] | None = None, filter_logic: str | None = None, sort: str | None = None, row_limit: int | None = None, params: Mapping[str, Any] | None = None) -> str

A report URL with the secret key in ?secretKey=, for Excel or Google Sheets.

It sends no request. Anyone with the URL can use the key: deleting the key (t3api keys revoke) is the only way to cut off a leaked URL, because rotating keeps the same key value.