Skip to main content

langchain-flashdata

Google Search, News, Images, Shopping, Videos and Places; YouTube search, metadata, transcripts, captions, license labels, channel data, autocomplete and media delivery for LangChain and LangGraph. Each task has a source-specific Python tool and a runnable guide.

This package is maintained by FlashData. It implements LangChain's BaseTool and BaseToolkit interfaces with synchronous and native asynchronous HTTP calls.

Installation

Requires Python 3.10 or newer (below Python 4). Install from PyPI:

pip install -U langchain-flashdata

Create an API key in the FlashData console, enable the sources you need, and provide it through your environment:

export FLASHDATA_API_KEY='YOUR_FLASHDATA_API_KEY'

The MIT package is free to install. FlashData API queries are paid and consume credits. Check current pricing and your account's available credits before running examples. Model provider charges are separate.

Quick start

from langchain_flashdata import FlashDataGoogleSearch

search = FlashDataGoogleSearch()
result = search.invoke({"query": "LangGraph durable execution", "num": 3})
for item in result["results"][0].get("organic", []):
    print(item.get("title"), item.get("link"))

All tools also accept api_key="..." at construction time. Do not put real keys in source files. Credentials are excluded from model-facing argument schemas and tool serialization.

Choose a task

Version 0.2.0 supports all 15 FlashData sources. Each class sends only its named source; importing a single class does not give an agent the other query tools.

Capability Class Inputs and result guide
Google Search FlashDataGoogleSearch Find citable web results for an agent
Google News FlashDataGoogleNews Build a topic briefing with publisher links
Google Images FlashDataGoogleImages Find image candidates with source pages
Google Shopping FlashDataGoogleShopping Compare merchant result snapshots
Google Video Search FlashDataGoogleVideos Discover video pages across websites
Google Places FlashDataGooglePlaces Find local business candidates
YouTube Search FlashDataYouTubeSearch Shortlist videos by topic
YouTube Extended Search FlashDataYouTubeExtendedSearch Collect a larger video discovery set
YouTube Video Metadata FlashDataYouTubeMetadata Inspect a video before deeper processing
YouTube Transcript FlashDataYouTubeTranscript Build timestamped transcript evidence
YouTube Captions FlashDataYouTubeCaptions Read the uploader-provided caption track
YouTube License Metadata FlashDataYouTubeTrainability Inspect the Creative Commons label
YouTube Channel Data FlashDataYouTubeChannel Snapshot a channel and recent uploads
YouTube Autocomplete FlashDataYouTubeSuggestions Explore phrasing before video search
YouTube Download FlashDataYouTubeDownload Deliver video or audio to customer storage

Two additional tools, FlashDataDownloadJob and FlashDataDownloadResult, read existing download jobs. Download submission is asynchronous and requires FLASHDATA_DOWNLOAD_STORAGE JSON in the application environment. Storage credentials are excluded from model-facing schemas. See the download guide before enabling it.

The original four classes and FlashDataToolkit() behavior remain compatible. The default toolkit still returns Google Search, YouTube Search, Metadata and Transcript. Select the needed sources explicitly for other workflows:

from langchain_flashdata import FlashDataToolkit

tools = FlashDataToolkit(sources=("google_news", "youtube_captions")).get_tools()

Selecting youtube_download adds its two readers and requires storage configuration. Google Search retains num=10, page=1, autocorrect=True; the five other Google tools omit unset options so the provider chooses its behavior. YouTube Search retains a default of 10 (maximum 20); Extended Search defaults to 20 (maximum 700) and uses a separate source/rate. Requested counts are not guaranteed.

Transcript defaults to automatic captions; Captions defaults to uploader captions. Both select English by default, read existing tracks, and never generate, translate or fall back. License Metadata inspects Creative Commons labels and does not grant training permission. See each guide for input constraints and exact output fields.

Use with a LangChain / LangGraph agent

The research example uses create_agent, which runs on LangGraph. The model chooses tools and arguments from the question. A tool call limit bounds the number of queries; it does not set a credit or dollar limit.

git clone https://github.com/rocosen/langchain-flashdata.git
cd langchain-flashdata
pip install '.[examples]'
export OPENAI_API_KEY='YOUR_MODEL_PROVIDER_KEY'
export OPENAI_MODEL='YOUR_TOOL_CALLING_MODEL'
# Optional for a Chat Completions compatible provider:
# export OPENAI_BASE_URL='https://YOUR_PROVIDER/v1'

python examples/research_agent.py \
  'Find recent LangGraph tutorials using Google Search. Request 3 results and cite their URLs.' \
  --max-tool-calls 1

This example uses ChatOpenAI with the Chat Completions API. Use a model that supports tool calling. You can replace that model adapter with another LangChain chat model. The FlashData tools do not depend on a particular model provider.

For a custom graph, pass the tools from FlashDataToolkit().get_tools() to LangGraph's ToolNode. Use handle_tool_errors=False to propagate query failures and stop execution before a model can resubmit an unknown-outcome query. Avoid automatic graph retries or replay of paid tool nodes.

from langchain_flashdata import FlashDataToolkit
from langgraph.prebuilt import ToolNode

tools = FlashDataToolkit().get_tools()
tool_node = ToolNode(tools, handle_tool_errors=False)

See the examples guide for direct tool calls, transcript research, and the hosted MCP alternative.

Output and errors

invoke and ainvoke return the complete API response dictionary. The envelope contains source, results, and available usage/timestamp fields; some successful responses omit status. Tool-call invocations produce a LangChain ToolMessage containing the JSON response.

Operation Data location
Google Search results[0].organic
YouTube search results[0].results
Video metadata results[0]
Transcript results[0].segments, with available fullText, languageCode, and isAutoGenerated

Invalid arguments fail locally before sending a request. API failures raise FlashDataError, a LangChain ToolException. HTTP 401 indicates an invalid key, 402 insufficient credits, 403 a source/access restriction, and 429 a rate/quota limit. Upstream error bodies and credentials are not included in exception messages.

Paid POST requests are not automatically retried or redirected. A timeout, connection failure, unreadable result, or unexpected response may occur after a query was submitted and charged: check Jobs in the FlashData console before submitting again. The client connects directly to FlashData over HTTPS, with a 15-second connect timeout and a 120-second I/O timeout. Environment proxy settings are not used.

Existing MCP users

You can also connect LangChain to the existing hosted MCP endpoint at https://data.flashdata.dev/mcp using the X-API-Key header. The native Python tools above cover all 15 sources; the MCP catalog also contains account operations and varies with key scopes. See hosted_mcp.py. The example uses the current langchain[mcp] API, which LangChain labels beta.

Development

uv sync --extra examples
uv run --extra examples pytest --disable-socket --allow-unix-socket
uv run ruff check .
uv run ruff format --check .
uv build
uv run twine check dist/*

Tests include LangChain's standard tool suite, request contracts, validation, sync/async calls, ToolMessage delivery, Agent error propagation, and tool budgets. Unit tests do not call external services. Run the four paid API integration tests explicitly with FLASHDATA_API_KEY configured:

FLASHDATA_RUN_LIVE=1 uv run --extra examples pytest tests/integration_tests -q

Release instructions: RELEASING.md. Data handling: PRIVACY.md. License: MIT. Support: support@flashdata.dev.

Metadata

Release files for langchain-flashdata 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-flashdata 0.2.2
File Size Uploaded Provenance Actions
langchain_flashdata-0.2.2.tar.gz 289.4 kB With provenance Details for langchain_flashdata-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-flashdata 0.2.2
File Interpreter ABI Platform Actions
langchain_flashdata-0.2.2-py3-none-any.whl Python 3 none any Details for langchain_flashdata-0.2.2-py3-none-any.whl

Total release size: 308.2 kB

Release files / langchain_flashdata-0.2.2.tar.gz

Download URL langchain_flashdata-0.2.2.tar.gz
Size 289.4 kB
Tags Source
SHA-256 checksum
How to use checksums
489951673c58ae0c136dd7a135f0ad50b42bc08fd359e8b0390776d9700221ca
BLAKE2b-256 checksum
How to use checksums
5907f19c703778fc3e659e0d154c9df241d9ec6d36fd0716a404ac6e87d29095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / langchain_flashdata-0.2.2-py3-none-any.whl

Download URL langchain_flashdata-0.2.2-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
648e06e34f93a6d61e964f19ff097e647a95ec16adcf7119da29480bba830427
BLAKE2b-256 checksum
How to use checksums
c2ebad82ddea8f8b13c219e5102da8f497306894f10c849799f9eb4d2991a2f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for langchain-flashdata 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_flashdata-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page