Download a script's source code and files as a compressed archive.

Authentication: JWT token required Access: Script must be accessible to current user based on permissions Format: Returns compressed tar.gz archive containing script files

Path Parameters:

  • script: Script identifier/slug or numeric ID

Response: Binary file download (tar.gz archive)

  • Content-Type: application/gzip
  • Content-Disposition: attachment; filename=script-name.tar.gz

Archive Contents:

  • Main script file(s) (Python, R, or other supported languages)
  • Configuration files (script metadata, requirements)
  • Dependencies and libraries (if included)
  • Documentation and README files
  • Supporting data files (if any)

Usage Examples:

# Download script archive
curl -H "Authorization: Bearer your_jwt_token"          -o vegetation-analysis.tar.gz          "https://api.trends.earth/api/v1/script/vegetation-analysis/download"

# Extract downloaded archive
tar -xzf vegetation-analysis.tar.gz

Access Control:

  • Users can download scripts they have execution access to
  • Admin users can download any script
  • Private scripts require explicit permission

Error Responses:

  • 401 Unauthorized: JWT token required
  • 403 Forbidden: No access to download this script
  • 404 Not Found: Script does not exist
  • 500 Internal Server Error: Download failed or file unavailable
get/api/v1/script/{script}/download

Path parameters

scriptstring required

Path parameter: script

Response

Success

object required

Changes

No recorded changes to this endpoint across all 1 revision of this API.