No logo available for Google ADK to DuckDB connector icon

Load Google ADK data to DuckDB

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

SourceGoogle ADKGoogle ADK API DocumentationDestinationDuckDBIn-process analytical database. The default local destination for dlt pipelines.

Google Ads API is a programmatic interface for managing Google Ads campaigns, accounts, and reporting data. Everything needed to build a working Google ADK → 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 Google ADK 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 Google ADK 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 Google ADK 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.


Google ADK API at a glance

Base URLhttps://googleads.googleapis.com/v{API_VERSION}
Example endpointGET apps/{app_name}/users/{user_id}/sessions
Records found atsessions
AuthenticationAll requests require an OAuth 2.0 access token and a developer token
PaginationCursor-based via page_token, next cursor at next_page_token, page size via page_size (default 20). Pagination is optional; omitting the pagination object returns all items. The Python SDK uses a SessionPagination object which also supports page_offset.
Incremental fieldpage_token
Record idid
API referencehttps://adk.dev/api-reference/rest/

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


How do I authenticate with the Google ADK API?

The API requires an OAuth 2.0 access token passed in the Authorization header as a Bearer token, along with a developer-token header for every request.

1. Get your credentials

To obtain credentials for an ADK-powered service, use the Google Cloud Console dashboard to generate the necessary API keys or Service Account JSON files. Navigate to APIs & Services > Credentials in your Google Cloud project. To programmatically manage these in your agent configuration, use the Google ADK AuthCredential class to instantiate the required credential type (e.g., API_KEY, SERVICE_ACCOUNT). If you are running the agent locally, start the API server with the 'web' and 'api' subcommands (e.g., go run agent.go web api), which exposes your agent's endpoints locally. For production deployments on Google Cloud (e.g., Cloud Run or GKE), the environment provides built-in authentication via Application Default Credentials.

2. Add them to .dlt/secrets.toml

[sources.google_adk_source] access_token = "REPLACE_ME"

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 Google ADK data can I load into DuckDB?

These are the Google ADK endpoints dlt can load into DuckDB:

ResourceEndpointMethodData selectorDescription
sessions/apps/{app_name}/users/{user_id}/sessionsGETsessionsList all sessions for a user within an app
artifact_versions/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts/{artifact_name}/versionsGETversionsList all versions of a specific artifact
artifact_names/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifactsGETartifact_namesList all artifact names for a session
apps/list-appsGETappsList all available applications
artifact_metadata/apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts/{artifact_name}/versions/metadataGETmetadataList metadata for all artifact versions

How do I load only new Google ADK records?

Google ADK exposes page_token on apps/{app_name}/users/{user_id}/sessions, 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": "sessions", "endpoint": { "path": "apps/{app_name}/users/{user_id}/sessions", "data_selector": "sessions", "incremental": {"cursor_path": "page_token", "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 Google ADK pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading /run and /run_sse from the Google ADK API into DuckDB:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def google_adk_source(access_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://googleads.googleapis.com/v{API_VERSION}", "auth": {"type": "bearer", "token": access_token}, }, "resources": [ {"name": "sessions", "endpoint": {"path": "apps/{app_name}/users/{user_id}/sessions", "data_selector": "sessions"}}, {"name": "artifact_versions", "endpoint": {"path": "apps/{app_name}/users/{user_id}/sessions/{session_id}/artifacts/{artifact_name}/versions", "data_selector": "versions"}} ], } yield from rest_api_resources(config) def load_google_adk_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="google_adk_pipeline", destination="duckdb", dataset_name="google_adk_data", ) load_info = pipeline.run(google_adk_source()) print(load_info) if __name__ == "__main__": load_google_adk_to_duckdb()

Run it with python google_adk_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 Google ADK 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("google_adk_pipeline").dataset() df = data.sessions.df() print(df.head())

SQL:

SELECT * FROM google_adk_data.sessions LIMIT 10;

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


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

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