AI-generated Key Takeaways
-
A report resource represents a specific report instance, detailing the data period and the download URL.
-
The API supports
getto retrieve metadata for a specific report andlistto list reports generated for a given job. -
Each report has properties like
id,jobId,startTime,endTime,createTime,jobExpireTime, anddownloadUrlthat identify it and specify its creation and data time. -
Reports are associated with a specific job, and the
jobExpireTimeindicates when the job will stop generating new reports, in which case a replacement may be available. -
The
downloadUrlproperty is where the report can be retrieved, and it's possible to use gzip compression to reduce the bandwidth needed for the download, by adding theAccept-Encoding: gzipheader.
A report resource identifies a specific instance of a report. The resource identifies the period of time for which the report contains data as well as the URL from which the report can be downloaded.
Methods
The following table shows the methods that the API supports for report resources.
| Methods | |
|---|---|
get |
Retrieves the metadata for a specific report. |
list |
Lists reports that have been generated for the specified reporting job. |
JSON resource representation
The JSON structure below shows the format of a report resource:
{
"id": string,
"jobId": string,
"startTime": timestamp,
"endTime": timestamp,
"createTime": timestamp,
"jobExpireTime": timestamp,
"downloadUrl": string
}Properties
The following table defines the properties that appear in this resource:
| Properties | |
|---|---|
id |
stringThe ID that YouTube assigns to uniquely identify the report. Each report is associated with a single job, though a job may be associated with many report IDs. |
jobId |
stringThe ID of the job that created this report. |
startTime |
timestampThe start of the time period that the report instance covers. The inclusive value is a timestamp in RFC3339 UTC "Zulu" format, accurate to microseconds. Example: "2015-10-02T15:01:23.045678Z". |
endTime |
timestampThe end of the time period that the report instance covers. The exclusive value is a timestamp in RFC3339 UTC "Zulu" format, accurate to microseconds. Example: "2015-10-02T15:01:23.045678Z". |
createTime |
timestampThe date and time that the job was created. The property value is a timestamp in RFC3339 UTC "Zulu" format, accurate to microseconds. Example: "2015-10-02T15:01:23.045678Z". |
jobExpireTime |
timestampThe date and time that the job that is associated with the report either expired or will expire. The property value is a timestamp in RFC3339 UTC "Zulu" format, accurate to microseconds. Example: "2015-10-02T15:01:23.045678Z".This property has a value if either the report type that is associated with the report's job has been deprecated or reports generated for that job have not been downloaded for a prolonged period of time. The value marks the date after which YouTube will no longer generate new reports for the job. If you have a job that identifies an expiration date, you should update your system to stop requesting the report by that date. In some cases, a replacement report may be available. |
downloadUrl |
stringThe URL from which the report can be downloaded. The property value has a maximum length of 1000 characters. To retrieve the report, send an HTTP GET request to this URL. In the request, set the Authorization HTTP Request header, using your authorization token as the header value.
Using gzip You can reduce the bandwidth needed to download reports by enabling gzip compression on download requests. While your application will need additional CPU time to uncompress API responses, the benefit of consuming fewer network resources usually outweighs that cost. To receive a gzip-encoded response, set the Accept-Encoding: gzip |