Load Harvest data to BigQuery
Build a Harvest to BigQuery pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the Harvest API base URL, auth, endpoints, and incremental loading.
Harvest is a REST API for managing time tracking, projects, tasks, expenses, and invoicing data. Everything needed to build a working Harvest → BigQuery 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 Harvest to BigQuery pipeline
Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.
uvx dlthub-init@latest to build a pipeline from Harvest to BigQuery and run it on dltHubThat 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 Harvest 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.
Harvest API at a glance
| Base URL | https://api.harvestapp.com/v2 |
| Example endpoint | GET v2/clients |
| Records found at | clients |
| Authentication | All requests require a Bearer token and a specific account ID header — sent in the Authorization header, prefixed Bearer |
| Also required | Harvest-Account-Id, User-Agent |
| Pagination | Cursor-based via cursor, page size via per_page (default 2000, max 2000). The API documentation recommends using the URLs provided in the links section of the response (first, next, previous, last) rather than manually constructing pagination parameters. The 'cursor' and 'page' parameters are mutually exclusive; 'cursor' takes precedence. The 'page' parameter is deprecated. |
| Incremental field | updated_at |
| Record id | id |
| API reference | https://help.getharvest.com/api-v2/introduction/overview/general/ |
These values come from the Harvest API reference — the authoritative source if anything here looks out of date.
How do I authenticate with the Harvest API?
Harvest requires authentication via an 'Authorization' header containing a Bearer token and a 'Harvest-Account-Id' header identifying the account. A 'User-Agent' header identifying your application name and contact link or email is also mandatory for all requests.
1. Get your credentials
To obtain your credentials for the Harvest REST API: 1. Log in to your Harvest ID account. 2. Navigate to the Developer tools or Developers section. 3. Under the 'Personal access tokens' area, click 'Create new personal access token'. 4. Enter a descriptive name for your token and click create. 5. Securely copy the generated Token and the associated Account ID, as these are required for all API requests.
2. Add them to .dlt/secrets.toml
[sources.harvest_source] access_token = "your_personal_access_token" account_id = "your_harvest_account_id" user_agent = "YourAppName (your@email.com)"
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 Harvest data can I load into BigQuery?
These are the Harvest endpoints dlt can load into BigQuery:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| clients | /v2/clients | GET | clients | List all clients |
| projects | /v2/projects | GET | projects | List all projects |
| time_entries | /v2/time_entries | GET | time_entries | List all time entries |
| invoices | /v2/invoices | GET | invoices | List all invoices |
| expenses | /v2/expenses | GET | expenses | List all expenses |
| users | /v2/users | GET | users | List all users |
How do I load only new Harvest records?
Harvest exposes updated_at on v2/clients, 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": "clients", "endpoint": { "path": "v2/clients", "data_selector": "clients", "incremental": {"cursor_path": "updated_at", "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 Harvest pipeline look like?
A standard dlt REST API pipeline — the same code you would write by hand, loading projects and time_entries from the Harvest API into BigQuery:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def harvest_source(access_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.harvestapp.com/v2", "auth": {"type": "bearer", "token": access_token}, }, "resources": [ {"name": "clients", "endpoint": {"path": "v2/clients", "data_selector": "clients"}}, {"name": "projects", "endpoint": {"path": "v2/projects", "data_selector": "projects"}} ], } yield from rest_api_resources(config) def load_harvest_to_bigquery() -> None: pipeline = dlt.pipeline( pipeline_name="harvest_pipeline", destination="bigquery", dataset_name="harvest_data", ) load_info = pipeline.run(harvest_source()) print(load_info) if __name__ == "__main__": load_harvest_to_bigquery()
Run it with uv run python harvest_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 Harvest data in BigQuery?
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("harvest_pipeline").dataset() df = data.projects.df() print(df.head())
SQL:
SELECT * FROM harvest_data.projects LIMIT 10;
See querying your data with dataset and exploring it in marimo notebooks.
How do I deploy the Harvest to BigQuery 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 Harvest loads into governed, documented models.
- Visualize & share — explore data in notebooks and publish live dashboards instead of static screenshots.
What other destinations can I load Harvest data to?
dlt loads into any of these — only the destination argument changes:
| Destination | Example 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 Harvest to BigQuery?
Request dlt skills, commands, AGENT.md files, and AI-native context.