HuntAPI

Submit the download job

Send the video URL and get a job ID back.

Call GET /v1/video/download with the video URL in query. The response immediately returns a job_id (HTTP 202).

import os
import requests

API_KEY = os.environ["HUNTAPI_API_KEY"]


def get(path, params):
    response = requests.get(f"https://api.huntapi.com{path}", headers={"x-api-key": API_KEY}, params=params)
    if not response.ok:
        raise SystemExit(f"Error {response.status_code}: {response.text}")
    return response.json()


VIDEO_URL = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

submitted = get("/v1/video/download", {"query": VIDEO_URL, "video_quality": "best"})
job_id = submitted["job_id"]
print(f"Job submitted: {job_id}")