FetchFox
Get started

Use FetchFox transcripts as a LangChain tool

A small REST tool lets a LangChain agent retrieve one transcript on demand. Keep the key in the server environment and make the tool’s credit cost clear to the agent.

Define a bounded tool

Install langchain and set FETCHFOX_API_KEY in your server environment. The code uses Python’s standard HTTP library and returns the same text and segment fields as the REST API.

Python tool
import json, os
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from langchain.tools import tool

@tool
def fetchfox_transcript(video_url: str) -> dict:
    """Read one public YouTube transcript. Costs 1 credit on success."""
    url = "https://api.fetchfox.net/youtube/transcript?" + urlencode({"url": video_url})
    request = Request(url, headers={"x-access-key": os.environ["FETCHFOX_API_KEY"]})
    with urlopen(request, timeout=120) as response:
        result = json.load(response)
    if not result.get("success"):
        raise RuntimeError("Transcript unavailable; inspect request history")
    return result["data"]

Add it to your agent

Pass fetchfox_transcript in the tools list when you create your LangChain agent. Ask for a single supplied URL and review the call before execution. Select and configure your language-model provider separately.

Preserve transcriptSegments timestamps and the source URL when creating citations or RAG chunks. Restrict calls per run and do not loop on unavailable captions. Model usage charges are separate from FetchFox credits.

Prefer MCP for discovery

You can also connect to https://mcp.fetchfox.net/mcp with Authorization: Bearer YOUR_KEY using LangChain’s current MCP support. The LangChain MCP namespace is evolving; follow its current transport/authentication documentation rather than copying older adapter examples. REST uses x-access-key; the two transports share the same FetchFox balance.

Sources

External documentation checked October 11, 2026. Client interfaces and third-party capabilities can change.

Continue building