Download the SDF

Once your operation has finished successfully and you’ve extracted the resource name from the completed operation response, you are ready to download the zip file containing your generated SDFs using the method.

Here's an example of how to use a client library to download the resulting file:


// Extract download file resource name to use in download request
String downloadResourceName = operationResponse.getResponse()

// Configure the request
Media.Download downloadRequest =

// Create output stream for downloaded file
FileOutputStream outStream =
   new FileOutputStream(output-file);

// Download file

System.out.printf("File downloaded to %s\n", outputFile);


# Extract download file resource name to use in download request
resourceName = operation["response"]["resourceName"]

# Configure the request
downloadRequest =

# Create output stream for downloaded file
outStream = io.FileIO(output-file, mode='wb')

# Make downloader object
downloader = googleHttp.MediaIoBaseDownload(outStream, downloadRequest)

# Download media file in chunks until finished
download_finished = False
while download_finished is False:
  _, download_finished = downloader.next_chunk()

print("File downloaded to %s" % output-file)


// Get client and set defer so it doesn't immediately return.
$client = $this->service->getClient();

// Build media download request.
$request = $this->service->media->download(
    array('alt' => 'media')

// Call the API, getting the generated SDF.
$response = $client->execute($request);
$responseBody = $response->getBody();

// Writes the downloaded file. If the file already exists, it is
// overwritten.
file_put_contents(output-file, $responseBody);

printf('File saved to: %s\n', output-file);

Once your file is downloaded and unzipped, your generated structured data files will be available to you. The generated files will have generic names identifying the SDF file type (example: SDF-LineItems.csv).

Skipped files

If data for a requested resource cannot be included in the corresponding structured data file, the zip file downloaded might include a "Skipped" file (example: SDF-LineItems-Skipped.csv). This file will have a two-column structure, the first containing the IDs of the resources that couldn’t be included and the second containing the reason for their exclusion.

Resources may be skipped for many reasons, including being in an unsupported state or of an unsupported type. Avoid having resources skipped by using the most recent version of SDF.