Problem trying to download database using API

Hey there!

I’m experiencing some troubles trying to download a database through API, because the headers returned after doing the request are just a bunch of symbols. Any idea why is this happening? If it helps, we are using a private server.

The reason you are seeing those symbols is because that’s the text representation of the zipped STATA file.

If you’re going to use the web interface to download the exports, you can just go to the ‘Data Export’ and download it from there.

For clarity, that API call doesn’t download the database, it downloads the STATA export of the data.

The API is meant to be used programmatically and the appropriate action taken depending on the response code as mentioned in the top of that API doc:

Downloads export file. It will return either 200 status code with export file content or 302 redirect to export location.

With a 200 status code, it has returned the export file content, which programmatically should be piped to a file.

1 Like