import requests headers = { "X-API-Key": "", "X-API-Secret": "" } API_BASE_URL = "https://swissdox.linguistik.uzh.ch/api" API_URL_DOWNLOAD = f"{API_BASE_URL}/download/6399ae50-0d80-4304-9d2a-d92fa3dc753c__2022_02_28T10_26_03.tsv.xz" r = requests.get( API_URL_DOWNLOAD, headers=headers ) if r.status_code == 200: print("Size of file: %.2f KB" % (len(r.content)/1024)) fp = open("./dataset.tsv.xz", "wb") fp.write(r.content) fp.close() else: print(r.text)