No logo available for Wistia to DuckDB connector icon

Load Wistia data to DuckDB

Build a Wistia to DuckDB pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the Wistia API base URL, auth, endpoints, and incremental loading.

SourceWistiaGetting Started with the Data APIDestinationDuckDBIn-process analytical database. The default local destination for dlt pipelines.

Wistia provides a REST API for programmatic access to account data, including medias, projects, and statistics, using JSON over HTTPS. Everything needed to build a working Wistia → DuckDB pipeline is on this page: the API's base URL, authentication, endpoints, pagination and incremental field — plus a prompt that hands the whole job to your coding agent.


Build your Wistia to DuckDB pipeline

Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.

Prompt
Run uvx dlthub-init@latest to build a pipeline from Wistia to DuckDB and run it on dltHub

That scaffolds a dltHub workspace and installs the dltHub AI harness — the project rules, the secrets-management skill, and the dlt MCP server your agent needs to work safely. From there it reads the Wistia API, proposes the endpoints to load, then writes, runs and validates the pipeline while you review rather than type. Credentials are inspected through MCP tools, so your agent never reads secrets.toml itself. How the LLM-native workflow works →

Prefer to write it yourself? Every fact the agent uses is below.


Wistia API at a glance

Base URLhttps://api.wistia.com
Example endpointGET v1/medias
Records found atmedias
AuthenticationAll requests require a Bearer token provided in the Authorization header — sent in the Authorization header, prefixed Bearer
PaginationCursor-based via cursor[before], cursor[after], cursor[enabled], page size via per_page. For offset-based pagination, use 'page' and 'per_page'. For cursor-based pagination, set 'cursor[enabled]=1' or use 'cursor[before]'/'cursor[after]'. 'per_page' is used in both modes. Cursor values are returned in the response objects.
Incremental fieldcursor
Record idhashed_id
API referencehttps://docs.wistia.com/docs/making-api-requests

These values come from the Wistia API reference — the authoritative source if anything here looks out of date.


How do I authenticate with the Wistia API?

Authentication is performed by including the API token as a Bearer token in the Authorization HTTP header (e.g., 'Authorization: Bearer YOUR_TOKEN_HERE'). Alternatively, for some endpoints, HTTP Basic authentication is supported with 'api' as the username and the API token as the password.

1. Get your credentials

  1. Log in to your Wistia account. 2. Click your profile avatar and select Account Settings. 3. In the left navigation, choose API. 4. Click Create New Token (or copy an existing token). 5. Give the token a name, set desired scopes, and save. 6. Copy the generated token for use as the API token.

2. Add them to .dlt/secrets.toml

[sources.wistia_source] api_token = "your_api_token_here"

dlt reads this file automatically at runtime. With the harness, the setup-secrets skill prompts you for the values and never handles the raw credential in chat. For production, see setting up credentials with dlt.


What Wistia data can I load into DuckDB?

These are the Wistia endpoints dlt can load into DuckDB:

ResourceEndpointMethodData selectorDescription
medias/v1/mediasGETLists all media belonging to the account.
folders/v1/foldersGETLists all folders (previously projects).
medias/modern/mediasGETLists media using the modern API version.
folders/modern/foldersGETLists folders using the modern API version.
media_stats/v1/medias/{hashed_id}/statsGETGets statistics for a specific media.

How do I load only new Wistia records?

Wistia exposes cursor on v1/medias, so dlt can request only the records that changed since the last run. Set it as the cursor_path and dlt tracks the high-water mark for you between runs.

{"name": "medias", "endpoint": { "path": "v1/medias", "data_selector": "medias", "incremental": {"cursor_path": "cursor", "initial_value": "2024-01-01T00:00:00Z"}, }}

On the first run dlt loads everything from initial_value; on every run after that it requests only what changed and appends with write_disposition="merge" if you set a primary key. See incremental loading.


What does the generated Wistia pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading v1/projects.json and v1/medias.json from the Wistia API into DuckDB:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def wistia_source(api_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.wistia.com", "auth": {"type": "bearer", "token": api_token}, }, "resources": [ {"name": "medias", "endpoint": {"path": "v1/medias", "data_selector": "medias"}}, {"name": "folders", "endpoint": {"path": "v1/folders", "data_selector": "folders"}} ], } yield from rest_api_resources(config) def load_wistia_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="wistia_pipeline", destination="duckdb", dataset_name="wistia_data", ) load_info = pipeline.run(wistia_source()) print(load_info) if __name__ == "__main__": load_wistia_to_duckdb()

Run it with python wistia_pipeline.py. The agent iterates on this until it loads cleanly — you review and approve, rather than write it from scratch.


How do I query Wistia data in DuckDB?

dlt creates one table per resource. Query the loaded data with Python or SQL — or ask your agent to, through the MCP server's execute_sql_query tool.

Python (pandas DataFrame):

import dlt data = dlt.pipeline("wistia_pipeline").dataset() df = data.medias.df() print(df.head())

SQL:

SELECT * FROM wistia_data.medias LIMIT 10;

See querying your data with dataset and exploring it in marimo notebooks.


How do I deploy the Wistia to DuckDB pipeline in production?

The pipeline runs locally, which is ideal for prototyping and one-off analysis. When you need it on a schedule, monitored on every load, and shared with your team, deploy the same dlt code on the dltHub platform — no infrastructure to maintain. The prompt above already ends with "run it on dltHub", so your agent can take it there directly.

  • Deploy & schedule — run the pipeline as a managed job with automatic retries.
  • Monitor — observable job queues, alerting, and load metrics for every run.
  • Transform — promote raw Wistia loads into governed, documented models.
  • Visualize & share — explore data in notebooks and publish live dashboards instead of static screenshots.

Book a demo →


What other destinations can I load Wistia data to?

dlt loads into any of these — only the destination argument changes:

DestinationExample value
PostgreSQL"postgres"
BigQuery"bigquery"
Snowflake"snowflake"
Redshift"redshift"
Databricks"databricks"
Filesystem (S3, GCS, Azure)"filesystem"

Set dlt.pipeline(destination="snowflake") and add credentials in .dlt/secrets.toml. On the dltHub platform the same pipeline runs against a managed Iceberg lakehouse. See the full destinations list.


Next steps

Was this page helpful?

Community Hub

Need more dlt context for Wistia to DuckDB?

Request dlt skills, commands, AGENT.md files, and AI-native context.