No logo available for Dota 2 to DuckDB connector icon

Load Dota 2 data to DuckDB

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

SourceDota 2Dota 2 API DocumentationDestinationDuckDBIn-process analytical database. The default local destination for dlt pipelines.

The Valve Dota 2 Web API provides programmatic access to official Dota 2 match and game data via the Steam Web API interfaces. Everything needed to build a working Dota 2 → 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 Dota 2 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 Dota 2 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 Dota 2 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.


Dota 2 API at a glance

Base URLhttps://api.steampowered.com
Example endpointGET proMatches
Authenticationall requests require an API key passed as a query parameter or header — sent in the request header
Also requiredx-webapi-key
PaginationCursor-based
Incremental fieldless_than_match_id
Record idmatch_id
API referencehttps://partner.steamgames.com/doc/webapi_overview/auth

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


How do I authenticate with the Dota 2 API?

The Valve Dota 2 Web API uses an API key provided as a 'key' query parameter or the 'x-webapi-key' header.

1. Get your credentials

To obtain credentials for the OpenDota API, visit https://api.opendota.com/login and authenticate with your Steam/OpenDota account. Once logged in, navigate to the API Keys section on your dashboard, click 'Generate New Key', and copy the provided API key. Note that while the API is free to use, generating an API key provides higher rate limits and is recommended for production use.

2. Add them to .dlt/secrets.toml

[sources.dota_2_source] api_key = "your_api_key_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 Dota 2 data can I load into DuckDB?

These are the Dota 2 endpoints dlt can load into DuckDB:

ResourceEndpointMethodData selectorDescription
heroesheroesGETReturns list of all heroes
pro_matchesproMatchesGETReturns list of recent professional matches
public_matchespublicMatchesGETReturns list of recent public matches
rankingsrankingsGETReturns list of top players by rank for heroes
teamsteamsGETReturns list of professional teams

How do I load only new Dota 2 records?

Dota 2 exposes less_than_match_id on proMatches, 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": "pro_matches", "endpoint": { "path": "proMatches", "incremental": {"cursor_path": "less_than_match_id", "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 Dota 2 pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading players/{account_id}/matches and proMatches from the Dota 2 API into DuckDB:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def dota_2_source(key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.steampowered.com", "auth": {"type": "api_key", "api_key": key, "name": "key", "location": "header"}, }, "resources": [ {"name": "pro_matches", "endpoint": {"path": "proMatches"}}, {"name": "heroes", "endpoint": {"path": "heroes"}} ], } yield from rest_api_resources(config) def load_dota_2_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="dota_2_pipeline", destination="duckdb", dataset_name="dota_2_data", ) load_info = pipeline.run(dota_2_source()) print(load_info) if __name__ == "__main__": load_dota_2_to_duckdb()

Run it with python dota_2_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 Dota 2 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("dota_2_pipeline").dataset() df = data.pro_matches.df() print(df.head())

SQL:

SELECT * FROM dota_2_data.pro_matches LIMIT 10;

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


How do I deploy the Dota 2 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 Dota 2 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 Dota 2 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 Dota 2 to DuckDB?

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