FlashData for Pydantic AI
Find ranked web sources, prepare news briefings, discover places, and research YouTube videos and existing subtitles. FlashData is an independent Pydantic AI capability that reads current schemas from the existing FlashData MCP service. It provides 14 query tools plus free pricing/job/result reads. The fifteenth workflow, media delivery to your own storage, uses the existing protected local CLI. See all 15 task workflows.
Free to install; data calls spend your own paid FlashData Credits. Model and storage costs are separate. This package is maintained by FlashData and is not a first-party Pydantic integration. A Git release, PyPI release, and official ecosystem listing are separate milestones.
Install and configure
Use Python 3.11+. The adapter is tested with Pydantic AI 2.61.0, FastMCP 4.1.3 and HTTPX2 2.16.0. Install from the public source release:
pip install 'pydantic-ai-flashdata @ git+https://github.com/rocosen/flashdata-mcp.git@pydantic-ai-v0.1.0#subdirectory=packages/pydantic-ai'
The package name in this repository does not establish PyPI availability. Review the pinned source before installation.
Get your API key and supply FLASHDATA_API_KEY through your launching environment or secret manager. Do not put the value in code, YAML, chat or logs. No credential files are read. Importing the package or constructing the capability does not connect or spend Credits. Discovery starts when an agent run enters the toolset and contacts https://data.flashdata.dev/mcp with X-API-Key.
from pydantic_ai import Agent, DeferredToolRequests
from pydantic_ai_flashdata import FlashData
agent = Agent(
"openai:gpt-4.1-mini", # choose your configured model; model fees are separate
capabilities=[FlashData(sources=["google_search", "google_news", "youtube_transcript"])],
output_type=[str, DeferredToolRequests],
)
Omit sources to offer all 14 query sources. Pass an explicit nonempty selection to scope an agent. Each run gets its own MCP toolset and HTTP client; the key is read when connecting and the client is closed with the session. This is an environment-based configuration for one credential identity per application process, not a multi-tenant key store.
Review a paid request
Ask the agent to prepare a request and read get_pricing for its source. Every query tool is wrapped with Pydantic AI's approval mechanism; get_pricing, get_job, and get_result are free reads. Your application must handle DeferredToolRequests, display the current price and exact arguments to the user, and resume only after their decision. Do not approve all deferred calls automatically. Include DeferredToolRequests in the output type as above.
For example:
Prepare a US English search for battery recycling research, requesting 10 results. Show the current Google Search price and exact request. Wait for my approval before submitting.
Use Pydantic AI's approval flow to pass decisions through DeferredToolResults. A denied request is not submitted. The adapter requests no model sampling, forwards no server instructions, excludes batch/download submissions and uses no provider-native MCP relay. HTTP redirects and environment proxies are disabled. Failed calls raise a generic error with no automatic retry; an interrupted query may already have been accepted and charged, so inspect existing Jobs before deciding to resubmit.
Save returned source URLs, IDs, timestamps and actual counts. For an asynchronous query, retain its job ID and use get_job and get_result; pending is not completion. Read only results the user has authorized. Tool results may contain private data and links. Configure your application's model-message and tracing retention appropriately; this adapter does not promise to sanitize all returned research data.
Agent specs
The stable serialization name is FlashData. Configuration contains only source names and an optional environment-variable name. The inherited from_spec() constructs the capability without credentials or network activity.
# agent.yaml
model: openai:gpt-4.1-mini
capabilities:
- FlashData:
sources: [google_search, google_news, youtube_transcript]
api_key_env: FLASHDATA_API_KEY
from pydantic_ai import Agent, DeferredToolRequests
from pydantic_ai_flashdata import FlashData
agent = Agent.from_file(
"agent.yaml",
custom_capability_types=[FlashData],
output_type=[str, DeferredToolRequests],
)
Media delivery and source limits
youtube_download is deliberately absent from the model-facing toolset. Use the protected local download workflow with Node.js 22.18+, your authorized storage, scoped storage credentials, content rights and byte-based cost approval. Credentials are sent to FlashData for delivery. Keep populated request files and delivery manifests outside agents, notebook outputs and telemetry. Storage charges are separate; a request-count quote is not a download estimate. Follow existing async jobs instead of blindly repeating submissions.
News does not promise article full text. Images returns metadata and URLs, not downloaded image files. Shopping does not guarantee stock or checkout prices. Places contact fields may be absent. YouTube Search requests at most 20 results and Extended at most 700 with different rates; neither guarantees counts. Transcript defaults to auto=true, Captions to auto=false; both retrieve existing tracks with no ASR or translation. License/CC labels do not grant training rights.
Validation and maintenance
Offline checks use the real Pydantic AI host with synthetic MCP responses, no external sockets, and no paid data/model call or storage write. They cover discovered schemas, source selection, approval/deferred execution, serialization, credentials, redirects and one-attempt failures. This is installation/protocol verification, not live retrieval validation.
From this package directory, run uv sync --frozen, uv run pytest, uv run ruff check ., uv run ruff format --check ., uv run python -m build, uv run twine check dist/*, and uv run python scripts/verify_install.py.
MIT license. Support, privacy, terms, source documentation.
Metadata
Release files for pydantic-ai-flashdata 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pydantic_ai_flashdata-0.1.0.tar.gz | 104.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydantic_ai_flashdata-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 111.9 kB
Release files / pydantic_ai_flashdata-0.1.0.tar.gz
| Download URL | pydantic_ai_flashdata-0.1.0.tar.gz |
|---|---|
| Size | 104.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0b3dac2cb7c1bccb4c3971068eb463f308fa811709ee749fdecb14563b59d1e
|
|
BLAKE2b-256 checksum How to use checksums |
d39ba5e48d8fb7a2d92421b203b3da41292f4061e258c6655fb3c5e5d5dc089d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 25, 2026.
Transparency logRelease files / pydantic_ai_flashdata-0.1.0-py3-none-any.whl
| Download URL | pydantic_ai_flashdata-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bdf9f5c1756f72ad788c72813a71a7de7c3f8bd9a0030b2dabab0fdbbc6d160
|
|
BLAKE2b-256 checksum How to use checksums |
b0219f0208a1b22d70f202aeb6b70a4158c676e386a613a6a1a95e7184137946
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 25, 2026.
Transparency logSecurity for pydantic-ai-flashdata 0.1.0
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pydantic_ai_flashdata-0.1.0.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 Oct 25, 2026.
Transparency logA 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.