No logo available for Coins.ph to DuckDB connector icon

Load Coins.ph data to DuckDB

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

SourceCoins.phCoins.ph API DocumentationDestinationDuckDBIn-process analytical database. The default local destination for dlt pipelines.

Coins.ph is a cryptocurrency exchange platform providing REST and WebSocket APIs for spot trading, market data, and account management. Everything needed to build a working Coins.ph → 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 Coins.ph 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 Coins.ph 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 Coins.ph 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.


Coins.ph API at a glance

Base URLhttps://api.pro.coins.ph
Example endpointGET openapi/v1/myTrades
AuthenticationSigned requests require an API key header and a HMAC-SHA256 signature in the query string — sent in the X-COINS-APIKEY header
PaginationNot paginated
Incremental fieldfromId
API referencehttps://docs.coins.ph/rest-api/

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


How do I authenticate with the Coins.ph API?

Signed requests require an 'X-COINS-APIKEY' header containing the API key and a 'signature' parameter (HMAC-SHA256) in the query string.

1. Get your credentials

  1. Log in to your Coins.ph account via web browser. 2. Navigate to your profile or Account Settings, then locate the Security section. 3. Click Manage next to API Management. 4. Click Create API and enter a label (remarks) for your key. 5. Enter your 2FA/Google Authentication code when prompted. 6. Copy the API Key and Secret; ensure you save the Secret securely as it will only be displayed once. 7. (Optional but recommended) Click Edit to configure IP address whitelisting. 8. Ensure your account is ID & Selfie verified and has 2FA enabled to meet API creation requirements.

2. Add them to .dlt/secrets.toml

[sources.coins_ph_source] api_key = "your_api_key_here" secret = "your_secret_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 Coins.ph data can I load into DuckDB?

These are the Coins.ph endpoints dlt can load into DuckDB:

ResourceEndpointMethodData selectorDescription
server_timeopenapi/v1/timeGETCheck server time
exchange_infoopenapi/v1/exchangeInfoGETExchange information
ticker_24hropenapi/quote/v1/ticker/24hrGET24hr ticker price change statistics
order_bookopenapi/quote/v1/depthGETSymbol order book
my_tradesopenapi/v1/myTradesGETAccount trade history

How do I load only new Coins.ph records?

Coins.ph exposes fromId on openapi/v1/myTrades, 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": "my_trades", "endpoint": { "path": "openapi/v1/myTrades", "incremental": {"cursor_path": "fromId", "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 Coins.ph pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading /openapi/v1/account and /openapi/quote/v1/ticker/24hr from the Coins.ph API into DuckDB:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def coins_ph_source(api_key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.pro.coins.ph", "auth": {"type": "api_key", "api_key": api_key, "name": "X-COINS-APIKEY", "location": "header"}, }, "resources": [ {"name": "my_trades", "endpoint": {"path": "openapi/v1/myTrades"}}, {"name": "all_orders", "endpoint": {"path": "openapi/v1/allOrders"}} ], } yield from rest_api_resources(config) def load_coins_ph_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="coins_ph_pipeline", destination="duckdb", dataset_name="coins_ph_data", ) load_info = pipeline.run(coins_ph_source()) print(load_info) if __name__ == "__main__": load_coins_ph_to_duckdb()

Run it with python coins_ph_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 Coins.ph 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("coins_ph_pipeline").dataset() df = data.openapi/v1/ping.df() print(df.head())

SQL:

SELECT * FROM coins_ph_data.openapi/v1/ping LIMIT 10;

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


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

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