No logo available for Maytapi WhatsApp API to DuckDB connector icon

Load Maytapi WhatsApp API data to DuckDB

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

SourceMaytapi WhatsApp APIMaytapi WhatsApp API API DocumentationDestinationDuckDBIn-process analytical database. The default local destination for dlt pipelines.

Maytapi is a WhatsApp API platform for sending and receiving messages, managing contacts, and automating WhatsApp interactions. Everything needed to build a working Maytapi WhatsApp 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 Maytapi WhatsApp API 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 Maytapi WhatsApp 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 Maytapi WhatsApp 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.


Maytapi WhatsApp API API at a glance

Base URLhttps://api.maytapi.com/api
Example endpointGET {phone_id}/getConversations
Authenticationall requests require the 'x-maytapi-key' header — sent in the x-maytapi-key header
PaginationNot paginated
Incremental fieldpage
API referencehttps://maytapi.com/whatsapp-api-documentation

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


How do I authenticate with the Maytapi WhatsApp API API?

All requests require the 'x-maytapi-key' header, which must contain your API token retrieved from the Maytapi console settings.

1. Get your credentials

To obtain your API credentials, log in to the Maytapi Console at https://console.maytapi.com/. Navigate to the Settings or Token page (typically found at https://console.maytapi.com/settings/token) to retrieve your unique Product ID and API Token (x-maytapi-key). Your Phone ID can be found in the Phones section of the dashboard or by using the /listPhones endpoint.

2. Add them to .dlt/secrets.toml

[sources.maytapi_whatsapp_api_source] product_id = "your_product_id_here" phone_id = "your_phone_id_here" api_token = "your_api_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 Maytapi WhatsApp API data can I load into DuckDB?

These are the Maytapi WhatsApp API endpoints dlt can load into DuckDB:

ResourceEndpointMethodData selectorDescription
conversations/{phone_id}/getConversationsGETRetrieves a paginated list of conversations
messages/{phone_id}/getMessages/{conversation_id}GETRetrieves paginated messages from a specific conversation
groups/{phone_id}/getGroupsGETRetrieves a paginated list of WhatsApp groups
contacts/{phone_id}/getContactsGETRetrieves all contacts for a specific instance
phones/listPhonesGETRetrieves a list of registered phone instances

How do I load only new Maytapi WhatsApp API records?

Maytapi WhatsApp API exposes page on {phone_id}/getConversations, 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": "conversations", "endpoint": { "path": "{phone_id}/getConversations", "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 Maytapi WhatsApp API pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading /listPhones and /sendMessage from the Maytapi WhatsApp API API into DuckDB:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def maytapi_whatsapp_api_source(api_key=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://api.maytapi.com/api", "auth": {"type": "api_key", "api_key": api_key, "name": "x-maytapi-key", "location": "header"}, }, "resources": [ {"name": "conversations", "endpoint": {"path": "{phone_id}/getConversations"}}, {"name": "messages", "endpoint": {"path": "{phone_id}/getMessages/{conversation_id}"}} ], } yield from rest_api_resources(config) def load_maytapi_whatsapp_api_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="maytapi_whatsapp_api_pipeline", destination="duckdb", dataset_name="maytapi_whatsapp_api_data", ) load_info = pipeline.run(maytapi_whatsapp_api_source()) print(load_info) if __name__ == "__main__": load_maytapi_whatsapp_api_to_duckdb()

Run it with python maytapi_whatsapp_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 Maytapi WhatsApp 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("maytapi_whatsapp_api_pipeline").dataset() df = data.conversations.df() print(df.head())

SQL:

SELECT * FROM maytapi_whatsapp_api_data.conversations LIMIT 10;

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


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

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