Supadata
Supadata
This page covers how to use the Supadata ecosystem within LangChain. It allows you to load data from YouTube, TikTok, and other platforms.
Installation and Setup
To use Supadata, you need to install the standalone integration package.
pip install supadata-langchainDocument Loader
The Supadata integration allows you to load content from various video platforms as LangChain documents. It supports fetching transcripts and metadata.
import os
from supadata_langchain import SupadataLoader
os.environ["SUPADATA_API_KEY"] = "YOUR_API_KEY"
loader = SupadataLoader()
# Fetch Transcript
docs = loader.load(
{
"url": "[https://www.youtube.com/watch?v=dQw4w9WgXcQ](https://www.youtube.com/watch?v=dQw4w9WgXcQ)",
"operation": "transcript",
"lang": "en",
"text": True,
"mode": "auto",
}
)
print(docs[0].page_content)
print(docs[0].metadata)Metadata
You can also fetch video structured metadata.
# Fetch Metadata
docs = loader.load(
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"operation": "metadata",
}
)
print(docs[0].page_content)Resources
- PyPI Package:
supadata-langchain - GitHub Repository:
supadata-ai/langchain-py
For detailed usage examples and API documentation, please refer to the official GitHub repository.