No logo available for Clockify to DuckDB connector icon

Load Clockify data to DuckDB

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

SourceClockifyDestinationDuckDBIn-process analytical database. The default local destination for dlt pipelines.

Clockify is a time-tracking platform offering REST APIs to programmatically access workspaces, users, projects, time entries and reports. Everything needed to build a working Clockify → 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 Clockify 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 Clockify 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 Clockify 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.


Clockify API at a glance

Base URLhttps://api.clockify.me/api/v1
Example endpointGET v1/workspaces
AuthenticationAll requests require an API key or addon token passed in the request header — sent in the request header
Also requiredX-Api-Key, X-Addon-Token
PaginationPage-number page size via page-size
Incremental fieldpage
API referencehttps://docs.clockify.me/

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


How do I authenticate with the Clockify API?

Requests must include an 'X-Api-Key' (or 'X-Addon-Token' for add-ons) header containing the corresponding API or addon key.

1. Get your credentials

To obtain your Clockify API credentials, log in to the Clockify web application and navigate to your Profile Settings by clicking on your profile icon. From there, select the Advanced tab. In the API Key section, click the Generate button to create a new API key, or manage existing ones if already present. Store this key securely immediately after generation, as it will not be viewable again once the dialog is closed.

2. Add them to .dlt/secrets.toml

[sources.clockify_source] api_key = "your_clockify_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 Clockify data can I load into DuckDB?

These are the Clockify endpoints dlt can load into DuckDB:

ResourceEndpointMethodData selectorDescription
workspaces/v1/workspacesGETGet all workspaces for the current user.
clients/v1/workspaces/{workspaceId}/clientsGETGet all clients on a workspace.
projects/v1/workspaces/{workspaceId}/projectsGETGet all projects on a workspace.
users/v1/workspaces/{workspaceId}/usersGETFind all users on a workspace.
time_entries/v1/workspaces/{workspaceId}/user/{userId}/time-entriesGETGet all time entries for a user in a workspace.

How do I load only new Clockify records?

Clockify exposes page on v1/workspaces, 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": "workspaces", "endpoint": { "path": "v1/workspaces", "incremental": {"cursor_path": "page", "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 Clockify pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading workspaces and user (or time-entries) from the Clockify API into DuckDB:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def clockify_source(api_key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.clockify.me/api/v1", "auth": {"type": "api_key", "api_key": api_key, "name": "X-Api-Key", "location": "header"}, }, "resources": [ {"name": "workspaces", "endpoint": {"path": "v1/workspaces"}}, {"name": "clients", "endpoint": {"path": "v1/workspaces/{workspaceId}/clients"}} ], } yield from rest_api_resources(config) def load_clockify_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="clockify_pipeline", destination="duckdb", dataset_name="clockify_data", ) load_info = pipeline.run(clockify_source()) print(load_info) if __name__ == "__main__": load_clockify_to_duckdb()

Run it with python clockify_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 Clockify 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("clockify_pipeline").dataset() df = data.workspaces.df() print(df.head())

SQL:

SELECT * FROM clockify_data.workspaces LIMIT 10;

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


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

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