Load BlockCypher Ethereum API data to DuckDB
Build a BlockCypher Ethereum API to DuckDB pipeline with your coding agent. One prompt scaffolds it with the dltHub AI harness, plus the BlockCypher Ethereum API API base URL, auth, endpoints, and incremental loading.
BlockCypher provides a RESTful API for interacting with Ethereum and other blockchains, enabling queries for chain state, addresses, transactions, and contracts. Everything needed to build a working BlockCypher Ethereum API → 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 BlockCypher Ethereum API to DuckDB pipeline
Paste this prompt into Claude, Codex, or Cursor. The agent does the rest.
PromptRunuvx dlthub-init@latestto build a pipeline from BlockCypher Ethereum API 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 BlockCypher Ethereum API 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.
BlockCypher Ethereum API API at a glance
| Base URL | https://api.blockcypher.com/v1 |
| Example endpoint | GET v1/eth/main/addrs/{address}/full |
| Records found at | txs |
| Authentication | All non-read-only requests require an API token passed as a URL query parameter — sent in the request query |
| Pagination | Via before, page size via limit. Pagination is achieved via filtering and limiting rather than cursor-based tokens. The 'before' parameter is used for paging, while 'limit' controls the page size. 'txstart' is used in specific endpoints (like blocks) to paginate transaction sets. Defaults and maximums vary by endpoint; for example, the address endpoint 'limit' defaults to 200 with a max of 2000. |
| API reference | https://www.blockcypher.com/dev/ethereum/ |
These values come from the BlockCypher Ethereum API API reference — the authoritative source if anything here looks out of date.
How do I authenticate with the BlockCypher Ethereum API API?
Authentication is performed by passing a user token as a URL query parameter named 'token'. The API does not support authentication via standard HTTP Authorization headers.
1. Get your credentials
To obtain credentials for the BlockCypher Ethereum API: 1. Navigate to the BlockCypher accounts portal at https://accounts.blockcypher.com. 2. Create a developer account and verify your email address. 3. Log in to the dashboard. 4. Locate the section labeled API Tokens. 5. Click the Create Token button, provide a name for your token, and save the generated value securely.
2. Add them to .dlt/secrets.toml
[sources.blockcypher_ethereum_api_source] token = "your_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 BlockCypher Ethereum API data can I load into DuckDB?
These are the BlockCypher Ethereum API endpoints dlt can load into DuckDB:
| Resource | Endpoint | Method | Data selector | Description |
|---|---|---|---|---|
| chain | /eth/main | GET | Returns general blockchain information | |
| block | /eth/main/blocks/$BLOCK_HASH | GET | Returns details for a specific block hash | |
| block_height | /eth/main/blocks/$BLOCK_HEIGHT | GET | Returns details for a specific block height | |
| address | /eth/main/addrs/$ADDRESS | GET | Returns basic address information and recent transactions | |
| address_full | /eth/main/addrs/$ADDRESS/full | GET | txs | Returns full address information including all transactions |
| tx | /eth/main/txs/$TXHASH | GET | Returns details for a specific transaction | |
| tx_unconfirmed | /eth/main/txs | GET | Returns a list of recent unconfirmed transactions |
How do I load only new BlockCypher Ethereum API records?
The BlockCypher Ethereum API 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": "address_full", "endpoint": { "path": "v1/eth/main/addrs/{address}/full", # 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 BlockCypher Ethereum API pipeline look like?
A standard dlt REST API pipeline — the same code you would write by hand, loading addrs/{address} and blocks/{block_hash} from the BlockCypher Ethereum API API into DuckDB:
import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def blockcypher_ethereum_api_source(api_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.blockcypher.com/v1", "auth": {"type": "api_key", "api_key": api_token, "name": "token", "location": "query"}, }, "resources": [ {"name": "address_full", "endpoint": {"path": "v1/eth/main/addrs/{address}/full", "data_selector": "txs"}}, {"name": "tx_unconfirmed", "endpoint": {"path": "v1/eth/main/txs", "data_selector": "txs"}} ], } yield from rest_api_resources(config) def load_blockcypher_ethereum_api_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="blockcypher_ethereum_api_pipeline", destination="duckdb", dataset_name="blockcypher_ethereum_api_data", ) load_info = pipeline.run(blockcypher_ethereum_api_source()) print(load_info) if __name__ == "__main__": load_blockcypher_ethereum_api_to_duckdb()
Run it with python blockcypher_ethereum_api_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 BlockCypher Ethereum API 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("blockcypher_ethereum_api_pipeline").dataset() df = data.tx_unconfirmed.df() print(df.head())
SQL:
SELECT * FROM blockcypher_ethereum_api_data.tx_unconfirmed LIMIT 10;
See querying your data with dataset and exploring it in marimo notebooks.
How do I deploy the BlockCypher Ethereum API 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 BlockCypher Ethereum API 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 BlockCypher Ethereum API 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 BlockCypher Ethereum API to DuckDB?
Request dlt skills, commands, AGENT.md files, and AI-native context.