No logo available for NetSuite to DuckDB connector icon

Load NetSuite data to DuckDB

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

SourceNetSuiteDestinationDuckDBIn-process analytical database. The default local destination for dlt pipelines.

NetSuite is a cloud-based ERP platform providing RESTful SuiteTalk APIs for programmatic access to records, analytics, and metadata. Everything needed to build a working NetSuite → 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 NetSuite 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 NetSuite 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 NetSuite 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.


NetSuite API at a glance

Base URLhttps://{account_id}.suitetalk.api.netsuite.com/services/rest
Example endpointGET record/v1/{record_type}
Records found atitems
AuthenticationSupports OAuth 2.0 (Bearer) or OAuth 1.0a (Token-Based Authentication) — sent in the Authorization header, prefixed Bearer
PaginationOffset-based page size via limit (default 100, max 1000). Pagination uses offset/limit-based offset pagination. The offset must be a positive integer divisible by the limit. Responses contain navigation links (rel: next) and metadata (hasMore) to identify subsequent pages.
Incremental fieldoffset

These values come from the NetSuite API documentation. Check them against the vendor's current reference before relying on them in production.


How do I authenticate with the NetSuite API?

Requests require an Authorization header using the format 'Bearer <access_token>' for OAuth 2.0. Alternatively, Token-Based Authentication (OAuth 1.0a) requires an Authorization header with HMAC-SHA256 signature parameters including consumer key, token id, token secret, and realm.

1. Get your credentials

To set up Token-Based Authentication (TBA) for the NetSuite REST API: 1. Enable the 'Token-Based Authentication' feature in your account under Setup > Company > Enable Features > SuiteCloud. 2. Create an integration record by navigating to Setup > Integration > Manage Integrations > New. Set the authentication type to 'Token-based Authentication' and save to receive your Consumer Key and Consumer Secret. 3. Navigate to Setup > Users/Roles > Access Tokens > New. 4. Select the previously created application, the user, and the role (ensure the role has 'REST Web Services' and 'Access Token Management' permissions). 5. Click Save to generate and retrieve your Token ID and Token Secret. Note: Consumer and Token secrets are only displayed once upon creation.

2. Add them to .dlt/secrets.toml

[sources.netsuite_source] consumer_key = "YOUR_CONSUMER_KEY" consumer_secret = "YOUR_CONSUMER_SECRET" token_id = "YOUR_TOKEN_ID" token_secret = "YOUR_TOKEN_SECRET" account_id = "YOUR_ACCOUNT_ID"

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 NetSuite data can I load into DuckDB?

These are the NetSuite endpoints dlt can load into DuckDB:

ResourceEndpointMethodData selectorDescription
records/record/v1/{recordType}GETitemsRetrieve a list of instances for a specific record type.
record_instance/record/v1/{recordType}/{id}GETRetrieve a single record by its internal ID.
metadata_catalog/record/v1/metadata-catalogGETAccess the OpenAPI 3.0 metadata for the REST API.
suiteql/query/v1/suiteqlPOSTitemsExecute SuiteQL queries for advanced data retrieval.
dataset/query/v1/dataset/{id}/resultGETRetrieve results from a saved analytics workbook dataset.

How do I load only new NetSuite records?

NetSuite exposes offset on record/v1/{record_type}, 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": "records", "endpoint": { "path": "record/v1/{record_type}", "data_selector": "items", "incremental": {"cursor_path": "offset", "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 NetSuite pipeline look like?

A standard dlt REST API pipeline — the same code you would write by hand, loading /services/rest/record/v1/ and /services/rest/query/v1/suiteql from the NetSuite API into DuckDB:

import dlt from dlt.sources.rest_api import RESTAPIConfig, rest_api_resources @dlt.source def netsuite_source(access_token=dlt.secrets.value): config: RESTAPIConfig = { "client": { "base_url": "https://{account_id}.suitetalk.api.netsuite.com/services/rest", "auth": {"type": "bearer", "token": access_token}, }, "resources": [ {"name": "records", "endpoint": {"path": "record/v1/{record_type}", "data_selector": "items"}}, {"name": "suiteql", "endpoint": {"path": "query/v1/suiteql", "data_selector": "items"}} ], } yield from rest_api_resources(config) def load_netsuite_to_duckdb() -> None: pipeline = dlt.pipeline( pipeline_name="netsuite_pipeline", destination="duckdb", dataset_name="netsuite_data", ) load_info = pipeline.run(netsuite_source()) print(load_info) if __name__ == "__main__": load_netsuite_to_duckdb()

Run it with python netsuite_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 NetSuite 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("netsuite_pipeline").dataset() df = data.records.df() print(df.head())

SQL:

SELECT * FROM netsuite_data.records LIMIT 10;

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


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

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