Skip to main content
GET
/
api
/
v1
/
files
/
{file_id}
/
download
Get File Download Url
import requests

url = "https://www.datalab.to/api/v1/files/{file_id}/download"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
curl --request GET \
--url https://www.datalab.to/api/v1/files/{file_id}/download \
--header 'X-API-Key: <api-key>'
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://www.datalab.to/api/v1/files/{file_id}/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://www.datalab.to/api/v1/files/{file_id}/download"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-Key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
{
  "download_url": "<string>",
  "expires_in": 123,
  "file_id": 123,
  "original_filename": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

X-API-Key
string
header
required

Path Parameters

file_id
integer
required

Query Parameters

expires_in
integer
default:3600

Cookies

wos-session
string
datalab_active_team
string

Response

Successful Response

Response with presigned download URL.

download_url
string
required

Presigned URL for downloading the file

expires_in
integer
required

URL expiry time in seconds

file_id
integer
required

File ID

original_filename
string
required

Original filename