Download report
Stay organized with collections
Save and categorize content based on your preferences.
After a Display & Video 360 report finishes generating successfully, download the
generated report file from the Google Cloud Storage path in the
Report
resource.
Here's how to retrieve the path from the report and download the report file:
Java
// The ID of the parent query.
Long queryId = query-id;
// The ID of the report to download.
Long reportId = report-id;
// The path to which to download the file.
String outputFilePath = output-file-path;
// Retrieve the report resource.
Report report =
service.queries().reports().get(queryId, reportId).execute();
// Download report file.
System.out.println("Downloading report file.");
DownloadUtils.downloadFileFromCloudStorage(
report.getMetadata().getGoogleCloudStoragePath(), outputFilePath);
System.out.printf(
"Report %s successfully downloaded at %s.%n",
report.getKey().getReportId(), outputFilePath);
Python
# The ID of the parent query.
query_id = query-id
# The ID of the relevant report resource.
report_id = report-id
# The path to which to download the file.
output_file_path = output-file-path
# Retrieve report.
report = service.queries().reports().get(
queryId=query_id,
reportId=report_id
).execute()
cloud_storage_path = report["metadata"]["googleCloudStoragePath"]
# Download file.
with open(output_file_path, "wb") as output:
with closing(urlopen(cloud_storage_path)) as url:
output.write(url.read())
print("Download complete.")
PHP
// The ID of the parent query.
$queryId = query-id;
// The ID of the report to download.
$reportId = report-id;
// The path to which to download the file.
$outputFilePath = output-file-path;
// Retrieve the report resource.
$report = $this->service->queries_reports->get($queryId, $reportId);
// Download the file.
file_put_contents(
$outputFilePath,
fopen($report->getMetadata()->getGoogleCloudStoragePath(), 'r')
);
printf(
'Report %s successfully downloaded at %s.<br>',
$reportId,
$outputFilePath
);
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eDisplay & Video 360 reports are stored in Google Cloud Storage after successful generation.\u003c/p\u003e\n"],["\u003cp\u003eYou can access the report file by retrieving its Google Cloud Storage path from the \u003ccode\u003eReport\u003c/code\u003e resource.\u003c/p\u003e\n"],["\u003cp\u003eCode samples demonstrate how to download the report file using the Google Cloud Storage path in Java, Python, and PHP.\u003c/p\u003e\n"]]],[],null,["# Download report\n\nAfter a Display \\& Video 360 report finishes generating successfully, download the\ngenerated report file from the [Google Cloud Storage path](//cloud.google.com/storage/docs) in the\n[`Report`](/bid-manager/reference/rest/current/queries.reports#Report) resource.\n\nHere's how to retrieve the path from the report and download the report file: \n\n### Java\n\n```java\n// The ID of the parent query.\nLong queryId = query-id;\n\n// The ID of the report to download.\nLong reportId = report-id;\n\n// The path to which to download the file.\nString outputFilePath = output-file-path;\n\n// Retrieve the report resource.\nReport report =\n service.queries().reports().get(queryId, reportId).execute();\n\n// Download report file.\nSystem.out.println(\"Downloading report file.\");\nDownloadUtils.downloadFileFromCloudStorage(\n report.getMetadata().getGoogleCloudStoragePath(), outputFilePath);\nSystem.out.printf(\n \"Report %s successfully downloaded at %s.%n\",\n report.getKey().getReportId(), outputFilePath);\n```\n\n### Python\n\n```python\n# The ID of the parent query.\nquery_id = query-id\n\n# The ID of the relevant report resource.\nreport_id = report-id\n\n# The path to which to download the file.\noutput_file_path = output-file-path\n\n# Retrieve report.\nreport = service.queries().reports().get(\n queryId=query_id,\n reportId=report_id\n).execute()\n\ncloud_storage_path = report[\"metadata\"][\"googleCloudStoragePath\"]\n\n# Download file.\nwith open(output_file_path, \"wb\") as output:\n with closing(urlopen(cloud_storage_path)) as url:\n output.write(url.read())\n print(\"Download complete.\")\n```\n\n### PHP\n\n```php\n// The ID of the parent query.\n$queryId = \u003cvar translate=\"no\"\u003equery-id\u003c/var\u003e;\n\n // The ID of the report to download.\n$reportId = \u003cvar translate=\"no\"\u003ereport-id\u003c/var\u003e;\n\n// The path to which to download the file.\n$outputFilePath = \u003cvar translate=\"no\"\u003eoutput-file-path\u003c/var\u003e;\n\n// Retrieve the report resource.\n$report = $this-\u003eservice-\u003equeries_reports-\u003eget($queryId, $reportId);\n\n// Download the file.\nfile_put_contents(\n $outputFilePath,\n fopen($report-\u003egetMetadata()-\u003egetGoogleCloudStoragePath(), 'r')\n);\n\nprintf(\n 'Report %s successfully downloaded at %s.\u003cbr\u003e',\n $reportId,\n $outputFilePath\n);\n```"]]