/rest-api-pipeline:optimize-rest-api-performance [pipeline-name] [symptom]from rest-api-pipeline
Speeds up dlt REST API pipelines by parallelizing resources, using async, tuning page size and concurrency. Diagnoses bottlenecks and applies targeted fixes for slow sequential requests, nested resources, or large responses.
Ships in rest-api-pipeline. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Source-specific tuning for rest_api pipelines. REST extraction is almost always network-bound, so the wins come from issuing more requests concurrently and fetching fewer, larger pages. Work the loop — diagnose → pick the fix → apply → measure → repeat, one change at a time. Combine these with the source-agnostic stage levers in the performance toolkit's optimize-performance skill.
Essential reading: https://dlthub.com/docs/dlt-ecosystem/verified-sources/rest_api/advanced
Parse $ARGUMENTS:
pipeline-name (optional): the dlt pipeline. If omitted, infer from session context; if ambiguous, ask and stop.symptom (optional): e.g. "thousands of sequential requests", "child resources are slow", "large pages time out".pipeline.last_trace (or progress="log"). To probe one resource cheaply, cap it with .add_limit(max_items=N) / .add_limit(max_time=seconds) and time a few pages — don't extrapolate from a single item."paginator" first (see adjust-endpoint).Match the symptom to a lever. They compose — apply every one that fits (a pipeline is often slow for several reasons); just don't tune what isn't the bottleneck.
| Symptom | Fix (see Apply) |
|---|---|
| One request per parent item (child/dependent resource dominates) | Parallelize the child resource |
| Many tiny pages / too many round-trips | Increase page size |
| Many independent endpoints run one-after-another | Run resources concurrently |
| Many small requests — per-request connection/TLS overhead | Reuse a shared HTTP session |
| Large responses; you only need part of each, or high parse memory | Extract just that with data_selector |
Parallelize a child resource — fetch children concurrently (transformer pattern, e.g. comments per post):
{
"name": "comments",
"endpoint": {"path": "posts/{post_id}/comments", ...},
"parallelized": True,
}
Memory caveat: all child pages for one parent are buffered in memory — skip for parents with very large child sets. See new-endpoint step 3A for the transformer syntax.
Increase page size — fewer, larger pages = fewer round-trips:
"endpoint": {"params": {"per_page": 100}} # use the API's documented max
Run resources concurrently — independent top-level (list) endpoints extract in parallel via the extract thread pool; size it in optimize-performance ([extract] workers).
For rest_api, parallelize top-level resources at the source level — the parallelized=True kwarg on rest_api_source(...), or .parallelize() on each resource:
source = rest_api_source(
{"client": {"base_url": "https://api.example.com"}, "resources": ["repos", "issues"]},
parallelized=True, # parallelizes the top-level list endpoints
)
# equivalently: src = rest_api_source(cfg); [src.resources[n].parallelize() for n in ("repos", "issues")]
For custom Python resources, pick one:
@dlt.resource(parallelized=True) # sync generator runs in the extract thread pool
def repos(): yield from fetch_repos()
@dlt.resource # @dlt.defer: fan out one call per item
def issues():
@dlt.defer
def get(repo): return requests.get(repo["issues_url"]).json()
for repo in repo_list: yield get(repo)
@dlt.resource # async: many awaits concurrent on one event loop
async def stars():
async for page in fetch_pages(): yield page
Reuse a shared HTTP session — pool connections so each request skips the TCP/TLS handshake; share one session across threads for concurrent resources:
import requests
session = requests.Session()
config = {"client": {"base_url": "<url>", "session": session}} # rest_api client config
Extract only what you need — data_selector — a JSONPath that pulls just the records from each response, so dlt skips parsing irrelevant fields (less CPU and memory):
"endpoint": {"path": "posts", "data_selector": "results.items"}
For rows the API can't filter server-side, drop them early with processing_steps (add_filter) so they never reach normalize/load.
pipeline.last_trace against step 1.Retry-After; for strict limits tune [runtime] request_max_attempts / request_backoff_factor / request_timeout (see adjust-endpoint), and back off concurrency if it 429s persistently.optimize-performance (install if not present: uv run dlthub --non-interactive ai toolkit install performance).debug-pipeline.uv run dlthub --non-interactive ai toolkit install dlthub-platform).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub dlt-hub/dlthub-ai-harness --plugin rest-api-pipeline8 skills in this plugin
/adjust-endpointAdjust a working dlt pipeline for production — remove dev limits, verify pagination (including stuck or looping paginators), configure incremental loading, expand date ranges, and handle rate-limit/429 errors with retries, backoff, and request timeouts. Use when the user wants to remove .add_limit(), load more data, fix stuck or looping pagination, set up incremental loading, or make the pipeline retry/back off on 429s. For throughput/concurrency tuning (parallel resources, page size) when a working pipeline is slow, use optimize-rest-api-performance instead. For inspecting loaded data, fixing column types, or flattening nested structures after a load, use validate-data instead./create-rest-api-pipelineCreate a dlt REST API pipeline. Use for the rest_api core source, or any generic REST/HTTP API source. Not for sql_database or filesystem sources./debug-pipelineDebug and inspect a dlt pipeline after running it. Use after a pipeline run (success or failure) to inspect traces, load packages, schema, data, and diagnose errors like missing credentials or failed load jobs. Also covers pipelines built on a verified source./find-sourceFind a dlt source for a given API or data provider. Use when the user asks about a source, wants to find a connector, or asks to implement a pipeline for a specific data source./new-endpointAdd a new REST API endpoint/resource to an existing dlt pipeline. Use when the user wants to pull additional data from an API that already has a working pipeline./validate-dataValidate schema and data after a successful dlt pipeline load. Use when the user wants to check if loaded data looks correct, inspect table schemas, fix data types, flatten nested structures, or refine the data shape.Other plugins' skills for the same job