Skip to main content

Download Dataset

Downloads the dataset from a repository.

URL

GET https://api.synodic.ai/v0/{user}/{repo}/download/dataset

Headers

  • x-api-key: YOUR_API_KEY (string)

Path Parameters

  • {user}: username (string)
  • {repo}: repository name (string)

Query Parameters

  • format: format (string)
  • train_percent: train percent (integer)
  • test_percent: test percent (integer)
  • valid_percent: valid percent (integer)

Example Request

import requests

headers = {
"x-api-key": "YOUR_API_KEY"
}

params = {
"format": "yolo",
"train_percent": 70,
"test_percent": 20,
"valid_percent": 10
}

download_json = {}
while 'url' not in download_json:
download_json = requests.get("https://api.synodic.ai/v0/{user}/{repo}/download/dataset", headers=headers, params=params)
time.sleep(0.5)

with open("dataset.zip", "wb") as file:
file.write(requests.get(download_json['url']).content)