npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

langchain-supadata

v0.1.0

Published

Supadata document loader integration for LangChain JS

Readme

langchain-supadata

Supadata document loader integration for LangChain JS.

This package provides a SupadataLoader that wraps the official @supadata/js SDK and exposes it as a LangChain BaseDocumentLoader.

It supports two core Supadata features:

  • Get Transcript – fetch transcripts (plain text or structured) for a URL.
  • Get Metadata – fetch structured metadata for a URL (YouTube or generic web page).

Installation

npm install langchain-supadata @langchain/core
# @supadata/js is installed transitively by this package
or with pnpm:
pnpm add langchain-supadata @langchain/core

You also need a Supadata API key from https://supadata.ai.

Set it as an environment variable:

export SUPADATA_API_KEY="your_api_key_here"

You can also pass the API key explicitly to the loader (see examples below).

Transcript (default operation)

import { SupadataLoader } from "langchain-supadata";

const loader = new SupadataLoader({
  urls: ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  // optional; will fall back to SUPADATA_API_KEY if omitted
  apiKey: process.env.SUPADATA_API_KEY,
  operation: "transcript", // default
  lang: "en",
  text: true,              // return plain-text transcript
  mode: "auto"             // "native" | "auto" | "generate"
});

const docs = await loader.load();

console.log(docs[0].pageContent.slice(0, 500));
console.log(docs[0].metadata);
// {
//   source: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
//   supadataOperation: "transcript",
//   lang: "en"
// }

If Supadata returns a long-running job, the loader will return a Document whose metadata.supadataOperation === "transcript_job" and metadata.jobId contains the job identifier. You can then poll Supadata directly using the SDK.

Metadata

import { SupadataLoader } from "langchain-supadata";

const loader = new SupadataLoader({
  urls: [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://supadata.ai"
  ],
  operation: "metadata"
});

const docs = await loader.load();

for (const doc of docs) {
  console.log(doc.metadata.source);
  console.log(doc.pageContent); // JSON string of metadata
}

For YouTube URLs, the loader calls supadata.youtube.video(...). For non-YouTube URLs, it calls supadata.web.scrape(...).

You can also pass through additional Supadata options:

const loader = new SupadataLoader({
  urls: ["https://supadata.ai"],
  operation: "metadata",
  params: {
    // forwarded to Supadata SDK:
    // e.g. custom selectors, language hints, etc.
    timeoutMs: 30000
  }
});

API

type SupadataOperation = "metadata" | "transcript";

interface SupadataLoaderParams {
  urls: string[];
  apiKey?: string;
  operation?: SupadataOperation;
  lang?: string;
  text?: boolean;
  mode?: "native" | "auto" | "generate";
  params?: Record<string, unknown>;
}

class SupadataLoader extends BaseDocumentLoader {
  constructor(params: SupadataLoaderParams);

  load(): Promise<Document[]>;
}

URLs: one or more URLs (YouTube, web pages, etc.). apiKey: optional, otherwise SUPADATA_API_KEY is used. operation: "transcript" (default): returns Document.pageContent as transcript text. "metadata": returns Document.pageContent as pretty-printed JSON string. params: extra options forwarded directly to the Supadata SDK.