{
 "schema_version": 1,
 "generated": "2026-11-01",
 "id": "dlt-hub-dlt--load-a-rest-api-into-duckdb-with-dlt",
 "repo": "dlt-hub/dlt",
 "repo_url": "https://github.com/dlt-hub/dlt",
 "repo_slug": "dlt-hub-dlt",
 "title": "Pull a REST API into a local database",
 "page_title": "How to pull a REST API into a local database with DLT",
 "summary": "Describe an API declaratively and let DLT handle requests, pagination, schema inference and typing.",
 "who": "A developer who needs API data in a queryable table today.",
 "problem": "Hand written extract scripts break on pagination and schema changes.",
 "outcome": "A DuckDB dataset you can query, plus a DataFrame of the loaded table.",
 "steps": [
  "Install the library and the destination extra with `pip install dlt` and `pip install \"dlt[duckdb]\"`",
  "Build a source with rest_api_source, giving the client base_url and a resource with its endpoint path",
  "Create the pipeline with DLT.pipeline, naming pipeline_name, destination and dataset_name, then call pipeline.run(source)",
  "Read the data straight back with pipeline.dataset() and .df()"
 ],
 "agent_prompt": "Using dlt-hub/dlt, write a pipeline that loads <my API endpoint> into DuckDB with rest_api_source and prints the first rows back as a DataFrame.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Beginner",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "Add the matching extra for any other destination, for example DLT[bigquery] or DLT[s3].",
 "category": "Data and analytics",
 "tags": [
  "Data and analytics"
 ],
 "lang": "",
 "requirements": [
  "Python 3.10 through 3.14, with 3.14 support described as experimental",
  "`pip install dlt` plus the extras for your sources and destinations",
  "Credentials for your destination in secrets.toml or environment variables"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "Source and destination credentials come from secrets.toml or environment variables, so keep them out of your code."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/dlt-hub-dlt/load-a-rest-api-into-duckdb-with-dlt/",
 "md": "https://dedupedai.com/use-cases/dlt-hub-dlt/load-a-rest-api-into-duckdb-with-dlt/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/dlt-hub-dlt--load-a-rest-api-into-duckdb-with-dlt.json",
 "api_version": "v1"
}
