No logo available for Copernicus Climate Data Store to DuckDB connector icon

Load Copernicus Climate Data Store data to DuckDB

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

SourceCopernicus Climate Data StoreCopernicus Climate Data Store API DocumentationDestinationDuckDBIn-process analytical database. The default local destination for dlt pipelines.

The Copernicus Climate Data Store (CDS) provides a service for programmatic access to climate data, often utilized via the cdsapi Python client library. Everything needed to build a working Copernicus Climate Data Store → 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 Copernicus Climate Data Store 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 Copernicus Climate Data Store 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 Copernicus Climate Data Store 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.


Copernicus Climate Data Store API at a glance

Base URLhttps://cds.climate.copernicus.eu/api
Example endpointGET api/retrieve/v1/processes
Authenticationrequests require an API key and URL to be configured in the client, often via a local configuration file or environment variables
PaginationNot paginated
API referencehttps://cds.climate.copernicus.eu/how-to-api

These values come from the Copernicus Climate Data Store API reference — the authoritative source if anything here looks out of date.


How do I authenticate with the Copernicus Climate Data Store API?

Authentication is handled by providing a Personal Access Token and API URL, typically stored in a ~/.cdsapirc configuration file. The credentials (key and url) are passed to the API client during initialization.

1. Get your credentials

  1. Navigate to the Copernicus Climate Data Store portal at https://cds.climate.copernicus.eu and sign in to your account. 2. Go to your user profile page at https://cds.climate.copernicus.eu/profile. 3. Locate the 'API key' section under your profile settings to view your personal access token.

2. Add them to .dlt/secrets.toml

[sources.copernicus_climate_data_store_source] api_url = "https://cds.climate.copernicus.eu/api" api_key = "your_personal_access_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 Copernicus Climate Data Store data can I load into DuckDB?

These are the Copernicus Climate Data Store endpoints dlt can load into DuckDB:

ResourceEndpointMethodData selectorDescription
processes/api/retrieve/v1/processesGETprocessesList of the available processes (datasets).
process_details/api/retrieve/v1/processes/{process_id}GETDescription of a specific process.
jobs/api/retrieve/v1/jobsGETjobsList of submitted jobs.
job_status/api/retrieve/v1/jobs/{job_id}GETStatus of a specific job.
job_results/api/retrieve/v1/jobs/{job_id}/resultsGETResults of a specific job.

How do I load only new Copernicus Climate Data Store records?

The Copernicus Climate Data Store API reference does not document a timestamp or sequence field for these endpoints, so there is nothing to advertise here as verified. Pick a field from the endpoints table above that increases with every write, then set it as the cursor_path.

{"name": "processes", "endpoint": { "path": "api/retrieve/v1/processes", # Replace with a field that increases on every write. "incremental": {"cursor_path": "REPLACE_ME", "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 Copernicus Climate Data Store pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading collections and datasets from the Copernicus Climate Data Store API into DuckDB:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def copernicus_climate_data_store_source(api_key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://cds.climate.copernicus.eu/api", "auth": {"type": "api_key", "api_key": api_key, "name": "key"}, }, "resources": [ {"name": "processes", "endpoint": {"path": "api/retrieve/v1/processes"}}, {"name": "jobs", "endpoint": {"path": "api/retrieve/v1/jobs"}} ], } yield from rest_api_resources(config) def load_copernicus_climate_data_store_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="copernicus_climate_data_store_pipeline", destination="duckdb", dataset_name="copernicus_climate_data_store_data", ) load_info = pipeline.run(copernicus_climate_data_store_source()) print(load_info) if __name__ == "__main__": load_copernicus_climate_data_store_to_duckdb()

Run it with python copernicus_climate_data_store_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 Copernicus Climate Data Store 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("copernicus_climate_data_store_pipeline").dataset() df = data.processes.df() print(df.head())

SQL:

SELECT * FROM copernicus_climate_data_store_data.processes LIMIT 10;

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


How do I deploy the Copernicus Climate Data Store 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 Copernicus Climate Data Store 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 Copernicus Climate Data Store 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 Copernicus Climate Data Store to DuckDB?

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