Exporting and Downloading Datasets
The DiVA API enables you to define a Marqeta platform dataset and export it as a compressed CSV file. You can choose between Zip or Gzip compression. After export, you use the API to download the compressed file.
Exporting a dataset as a file
Copy section link
You can export any dataset as a CSV file by sending a
Then insert the
By default, the resulting dataset is compressed as a
Because the export operation is processed asynchronously, you should receive an immediate
Downloading the exported file
Copy section link
Note
By default, the DiVA API returns 1,048,575 rows in a file export and can take several minutes to generate the file. You can increase the download limit up to 5,000,000 rows by including theTo retrieve your file, send a
Note
TheThe API returns one of these responses:
-
If the job is not finished: The
202 "Accepted"HTTP response code and a plain-text body containing the wordPending. -
If the job is finished: The
200 "OK"HTTP response code and the file as an application/octet-stream. -
If the job has expired: The
410 "Gone"HTTP response code. Completed jobs expire after 60 minutes.
When saving your file, use the same filename extensions you used in your URL request, for example:
The following example of Python code illustrates how you can download an exported report file in CSV format: