Home
Support Forums

Using the API or CLI to download a deployed build

My site name is https://examples.ml5js.org.

My goal is to perform the “Download a Deploy” function through the API or through the CLI. I’d like to be able to download the built files in scripts that we run on other servers. Is there any way of doing this using currently-existing tools?

Hey @bomanimc,
We don’t have one API call that does it all, but we do have a call that will return all file paths deployed with your site: https://open-api.netlify.com/#operation/listSiteFiles

So you’d make a GET request to that endpoint, check the path that’s returned for each file, and then you’d have to write code to download each of them (each file will be available at your-netlify-url.netlify.app/:path-returned-by-api-call

You can use Netlify’s js-client or Postman to make that call. You will need a personal access token, which this article describes how to get:

Let us know how it goes or if you run into any issues along the way.