Tutorial
|
by Hunt Team

Download Videos from Your AI Assistant with Hunt API MCP

The Model Context Protocol (MCP) lets AI assistants — Claude Code, Cursor, Gemini CLI, OpenAI Developer Mode — call external services as tools. Hunt API's MCP server exposes video and audio download as first-class tools: your AI agent types a URL, Hunt API downloads the file on its own infrastructure, and returns a link.

No local yt-dlp. No FFmpeg paths. No bandwidth spike. The download happens on Hunt API's servers, not yours.

Why Download Remotely Instead of Locally?

Running yt-dlp on your own machine works for occasional downloads. It breaks down as soon as you need scale, reliability, or background processing.

1. Your Network Stays Free

A 4K YouTube video is 2–4 GB. Downloading it locally pegs your uplink, slows everything else, and blocks your terminal until it finishes. With Hunt API's MCP, the download runs on remote infrastructure. Your connection only transfers the final hosted URL — a few bytes.

2. Parallel Downloads in the Background

Hunt API's endpoints are asynchronous. Every download call returns a job_id immediately. Your AI agent moves on to the next task while the download processes in the background. You can trigger ten downloads in seconds and poll for results whenever you want.

// Trigger a download
GET /v1/video/download?query=https://youtube.com/watch?v=...
→ { "job_id": "0193443f-fb80-9d19-29ba-82bc77c7cd84" }

// 30 seconds later, poll for the result
GET /v1/jobs/0193443f-fb80-9d19-29ba-82bc77c7cd84
→ { "status": "CompletedJob", "result": { "response": "https://s3.huntapi.com/videos/..." } }

3. Webhooks for Fire-and-Forget Pipelines

Pass a webhook_url and Hunt API will POST the result to your endpoint when the download finishes — up to 3 retries with a 5-second delay. Your agent does not need to poll at all. This is the pattern for production pipelines: trigger a batch, handle results as they arrive.

GET /v1/video/download?query=...&webhook_url=https://your-server.com/hook

4. No Binary Dependencies

yt-dlp requires a Python runtime. FFmpeg requires compiled binaries in your PATH. Both need updates as platforms change their formats. Hunt API handles all of that server-side. From your agent's perspective, downloading a video is a single GET request.

5. Geo-Restrictions and Proxies, Already Solved

Hunt API's infrastructure handles geo-blocked content and rotating proxies automatically. Your AI assistant does not need to know where the video is hosted, what region it is locked to, or how to bypass rate limits. It just passes a URL and gets a file back.

6. Quality and Format Control

The API exposes all the parameters you need without manual yt-dlp flags:

  • Video quality: best, 1080p, 720p, 480p, 360p
  • Output format: mp4, webm, mkv
  • Download type: audio_video, audio, video
  • Max duration: clip long videos automatically
  • Audio quality: best, 320kbps, 256kbps, 128kbps
  • Audio format: mp3, m4a, wav

Your AI agent can request exactly what it needs without string-formatting complex CLI flags.


Setting Up Hunt API MCP in Your AI Client

Claude Code

claude mcp add --transport http huntapi https://mcp.huntapi.com/ \
  --header "x-api-key: YOUR_API_KEY"

Once added, Claude Code can call download_video and download_audio as tools directly from a conversation or an agentic task.

Cursor

In Settings → MCP, add an HTTP server, or drop a mcp.json file at the root of your project:

{
  "mcpServers": {
    "huntapi": {
      "url": "https://mcp.huntapi.com/",
      "headers": {
        "x-api-key": "YOUR_API_KEY"
      }
    }
  }
}

Never commit your API key. Use an environment variable or a .env-based placeholder.

Gemini CLI and OpenAI Developer Mode

Point the client at https://mcp.huntapi.com/ and pass x-api-key as a header. See the full MCP setup guide for client-specific instructions.


Practical Use Cases

Research and Transcription Pipelines

Ask your AI assistant to download a lecture, podcast, or conference talk as audio. Once the job_id resolves, pass the URL to a transcription tool (Whisper, AssemblyAI) — all in the same conversation, without leaving the IDE.

You:     Download the audio from this YouTube talk and transcribe it.
Claude:  Downloading audio via Hunt API... job_id received.
         [30s later] Download complete. Sending to Whisper...
         Here is the transcript: ...

Batch Competitive Intelligence

Give your agent a list of competitor video URLs. It triggers all downloads simultaneously via the MCP tool, collects the results, transcribes each one, and returns a comparative summary — while you do something else.

Content Archival Without a Server

No S3 bucket to configure, no yt-dlp daemon to run. Your AI agent downloads the video to Hunt API's storage and returns a hosted URL you can share or pass downstream. The file stays available long enough for your pipeline to consume it.

Automated Clip Extraction

Use the max_duration parameter to extract only the first N seconds of a video. Useful for previews, thumbnail generation pipelines, or checking whether a video is worth processing in full before committing credits to the full download.


How the Async Model Protects You

Each download call costs 1 credit and only bills on success. If the video is private, deleted, or age-restricted, you are not charged. The error comes back on the job result with a clear message.

{
  "status": "Error",
  "error": "Private video: the owner has restricted access."
}

This makes Hunt API safe to use in bulk: fire off a hundred job requests, pay only for the ones that succeed, and handle errors per-job without your whole pipeline crashing.


Getting Started

  1. Create a free account — no credit card required to start.
  2. Generate an API key in the dashboard under API Keys.
  3. Add the MCP server to your AI client (see setup above).
  4. Ask your assistant to download a video.

Full documentation at docs.huntapi.com/mcp.

Sources

VIDEO API

Discover why Hunt is the preferred API provider for developers.