Load Track123 data to DuckDB
Build a Track123 to DuckDB pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the Track123 API base URL, auth, endpoints, and incremental loading.
Track123 is a multi-carrier shipment tracking API that provides real-time access to global tracking data and status updates. Everything needed to build a working Track123 → 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 Track123 to DuckDB pipeline
Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.
PromptRunuvx dlthub-init@latestto build a pipeline from Track123 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 Track123 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.
Track123 API at a glance
| Base URL | https://api.track123.com/gateway/open-api/ |
| Example endpoint | GET tk/v2/carrier/list |
| Authentication | all requests require an API key passed in the 'Track123-Api-Secret' header — sent in the Track123-Api-Secret header |
| Also required | Track123-Api-Secret |
| Pagination | Cursor-based via cursor, page size via queryPageSize (default 100, max 100). The cursor is returned in the response object to be used for the next page. Pagination uses the 'cursor' parameter for the token and 'queryPageSize' for the limit. |
| Record id | trackNo |
| API reference | https://docs.track123.com/reference |
These values come from the Track123 API reference — the authoritative source if anything here looks out of date.
How do I authenticate with the Track123 API?
All API requests require the 'Track123-Api-Secret' header containing your API key.
1. Get your credentials
To obtain your Track123 API credentials: 1. Log in to the Track123 Admin Portal (or register if you do not have an account). 2. Navigate to the Developers section. 3. Select API. 4. Copy and securely save your API key.
2. Add them to .dlt/secrets.toml
[sources.track123_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 Track123 data can I load into DuckDB?
These are the Track123 endpoints dlt can load into DuckDB:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| carriers_list | tk/v2/carrier/list | GET | List all supported carriers | |
| ocean_carriers | tk/v2/ocean/carrier/list | GET | List all supported ocean carriers | |
| register_trackings | tk/v2/track/import | POST | Register new trackings | |
| get_trackings | tk/v2/track/query | POST | data | Query existing trackings |
| detect_carrier | tk/v2/carrier/detect | POST | Detect carrier by tracking number |
How do I load only new Track123 records?
The Track123 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": "carriers_list", "endpoint": { "path": "tk/v2/carrier/list", # 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 Track123 pipeline look like?
A standard dlt REST API pipeline — the same code you would write by hand, loading /tk/v2/carrier/list and /tk/v2/track/query from the Track123 API into DuckDB:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def track123_source(api_key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.track123.com/gateway/open-api/", "auth": {"type": "api_key", "api_key": api_key, "name": "Track123-Api-Secret", "location": "header"}, }, "resources": [ {"name": "carriers_list", "endpoint": {"path": "tk/v2/carrier/list"}}, {"name": "get_trackings", "endpoint": {"path": "tk/v2/track/query", "data_selector": "data"}} ], } yield from rest_api_resources(config) def load_track123_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="track123_pipeline", destination="duckdb", dataset_name="track123_data", ) load_info = pipeline.run(track123_source()) print(load_info) if __name__ == "__main__": load_track123_to_duckdb()
Run it with python track123_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 Track123 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("track123_pipeline").dataset() df = data.get_trackings.df() print(df.head())
SQL:
SELECT * FROM track123_data.get_trackings LIMIT 10;
See querying your data with dataset and exploring it in marimo notebooks.
How do I deploy the Track123 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 Track123 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 Track123 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 Track123 to DuckDB?
Request dlt skills, commands, AGENT.md files, and AI-native context.