{
 "kind": "api",
 "slug": "duckdb",
 "path": "apis/duckdb/",
 "name": "DuckDB",
 "logo": "https://agentgid.com/media/avatars/duckdb.png",
 "maker": "DuckDB Foundation / DuckDB Labs",
 "density": "full",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "Databases and backends",
   "apis/backend-db/"
  ]
 ],
 "lead": "Fast SQL on your data files, no server.",
 "chips": [
  {
   "label": "Databases and backends",
   "path": "apis/backend-db/"
  }
 ],
 "primary": {
  "label": "Copy prompt for your agent",
  "copy": "Use DuckDB to analyze data/orders.csv: pin duckdb==2.0.0, query the file directly with SQL from Python, use con.execute() when I need fetchone(), and keep the database file on a local disk, not a network share."
 },
 "links": [
  {
   "label": "Website",
   "href": "https://duckdb.org"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/duckdb/duckdb"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Open source",
   "status": "yes",
   "sub": "Run it yourself for free",
   "quote": null,
   "note": "No free tier on the pricing page. As reported on the official pricing page, checked Oct 10, 2026.",
   "src": "https://duckdb.org"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "Allowed",
   "status": "yes",
   "sub": null,
   "quote": "All components of DuckDB are available in the free version under this license: there is no \"enterprise version\" of DuckDB.",
   "note": "MIT; free in paid products, and there is no paid edition.",
   "src": "https://duckdb.org/faq"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "API key",
   "status": "info",
   "sub": "Env var none",
   "quote": null,
   "note": "None. DuckDB is an embedded library with no account or key; reading private cloud storage uses that storage's own credentials (CREATE SECRET).",
   "src": "https://duckdb.org/docs/2.0/clients/python/overview.html"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Community MCP server",
   "status": "cond",
   "sub": "llms.txt · SDK",
   "quote": null,
   "note": " Our agent check: 3 of 6 (Nov 13, 2026).",
   "src": "https://duckdb.org/llms.txt"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Oct 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What DuckDB does",
   "parts": [
    {
     "t": "prose",
     "text": "DuckDB is a free open-source database that runs inside your app or script, so there is no server to install and no online service or account. You ask questions in SQL straight on spreadsheet-like files such as CSV, Parquet or JSON and get answers in seconds, even on millions of rows. It also runs in a web browser, keeping the data on the user's device."
    },
    {
     "t": "list",
     "items": [
      "DuckDB is one of 29 APIs in the Databases and backends category on AgentGid.",
      "It is one of 26 that can be started for free.",
      "8 of them ship an official MCP server; DuckDB does not.",
      "Its official SDK is the 2nd most downloaded in the category (27.4M a week)."
     ],
     "muted": true
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Reports from a CSV export",
       "text": "Turn a large sales or sign-up export into totals per product or per month with one query, without loading it into a spreadsheet.",
       "idea": false
      },
      {
       "title": "Data files stored online",
       "text": "Query a CSV or Parquet file that sits at a web address or in cloud storage, without downloading it first.",
       "idea": false
      },
      {
       "title": "SQL on pandas tables in notebooks",
       "text": "In a Python notebook, run SQL directly on tables you already loaded with pandas or Polars, with no copying or importing.",
       "idea": false
      },
      {
       "title": "Analytics inside a web page",
       "text": "Let visitors filter and sum a dataset in their own browser, so the data never goes to your server.",
       "idea": false
      },
      {
       "title": "Small database file for a Node.js app",
       "text": "Keep reporting data in one file next to your Node.js backend and query it with SQL, without running a database server.",
       "idea": false
      },
      {
       "title": "Data dashboard in Python",
       "text": "Build a small interactive dashboard where each chart is a DuckDB query over your files.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "DuckDB popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "26.3M",
       "l": "SDK downloads a week",
       "d": "+34.1% on the 4-week average",
       "up": true
      },
      {
       "n": "226",
       "l": "public agent repos use its SDK"
      },
      {
       "n": "43.4K",
       "l": "GitHub stars, duckdb/duckdb"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "None"
      },
      {
       "l": "Cheapest plan",
       "v": "No monthly plan"
      },
      {
       "l": "Usage price",
       "v": "—"
      },
      {
       "l": "Plans",
       "v": "Embedded library, no hosted service from DuckDB itself; the MCP server commonly used (mcp-server-motherduck) is published by MotherDuck, a separate company. DuckDB 2.0.0 was released on 2026-10-21. DuckLabs joined AWS in September 2026; the project IP stays with the DuckDB Foundation under MIT (DuckDB FAQ)."
      }
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Oct 10, 2026. Prices change: confirm before you buy.",
     "link": "",
     "href": null
    }
   ]
  },
  {
   "id": "access",
   "nav": "Access and terms",
   "h2": "Key and access",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "How it signs in",
       "v": "None. DuckDB is an embedded library with no account or key; reading private cloud storage uses that storage's own credentials (CREATE SECRET)."
      },
      {
       "l": "Environment variable",
       "v": "none",
       "code": true
      },
      {
       "l": "Safe in browser code",
       "v": "Yes",
       "status": "yes"
      },
      {
       "l": "Card at sign-up",
       "v": "No"
      }
     ]
    }
   ]
  },
  {
   "id": "terms",
   "nav": null,
   "spy_as": "access",
   "h2": "Commercial use and your data",
   "parts": [
    {
     "t": "prose",
     "text": "DuckDB is MIT-licensed and free, including in paid products; keep the license notice when you ship it. There is no paid edition with extra features."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "Yes",
       "status": "yes",
       "sub": "MIT; free in paid products, and there is no paid edition.",
       "quote": "All components of DuckDB are available in the free version under this license: there is no \"enterprise version\" of DuckDB.",
       "src": "https://duckdb.org/faq"
      },
      {
       "l": "inside-app-bundle",
       "v": "With conditions",
       "status": "cond",
       "sub": "You may ship it inside your app; include the MIT copyright and permission notice.",
       "quote": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
       "src": "https://github.com/duckdb/duckdb/blob/main/LICENSE"
      },
      {
       "l": "redistribute-files",
       "v": "With conditions",
       "status": "cond",
       "sub": "Allowed under MIT with the notice kept.",
       "quote": "to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software",
       "src": "https://github.com/duckdb/duckdb/blob/main/LICENSE"
      },
      {
       "l": "client-work",
       "v": "Yes",
       "status": "yes",
       "sub": "MIT allows use in work for clients.",
       "quote": "This is why DuckDB is released under the very permissive MIT License and the project's intellectual property is held by the DuckDB Foundation .",
       "src": "https://duckdb.org/why_duckdb"
      }
     ]
    }
   ]
  },
  {
   "id": "errors",
   "nav": null,
   "spy_as": "access",
   "h2": "Errors to handle",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "AttributeError \"Relations no longer have fetchone()\"",
       "v": "DuckDB 2.0 removed fetchone() and fetchmany() from relations returned by sql().",
       "sub": "Use con.execute(query).fetchone(), or rel.limit(1).fetchall()."
      },
      {
       "l": "Transaction conflict: cannot update a table that has been altered!",
       "v": "Two transactions changed the same rows at the same time.",
       "sub": "Run the transaction again."
      },
      {
       "l": "TransactionException: Current transaction is aborted (please ROLLBACK)",
       "v": "A statement failed inside an open transaction.",
       "sub": "Call con.rollback(), then run the statements again."
      },
      {
       "l": "Out of memory",
       "v": "The query needs more memory than DuckDB is allowed to use, or the system killed it.",
       "sub": "Lower memory_limit to 50-60% of RAM, use fewer threads, or SET preserve_insertion_order = false."
      },
      {
       "l": "Missing extension",
       "v": "The query needs an extension that cannot be loaded automatically.",
       "sub": "Run INSTALL and LOAD for the extension named in the error."
      }
     ]
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "3 of 6: llms.txt yes, OpenAPI no, SDK yes, MCP no, status page no, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "Community servers only",
       "sub": null
      },
      {
       "l": "npm",
       "v": "npm install @duckdb/node-api",
       "code": true
      },
      {
       "l": "PyPI",
       "v": "pip install duckdb",
       "code": true
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "DuckDB",
       "me": true,
       "facts": [
        "Free (open source)",
        "No free tier"
       ]
      },
      {
       "name": "ClickHouse Cloud",
       "why": "Pick ClickHouse Cloud when many people or services need one managed analytics database, with compute and storage scaled separately.",
       "path": "apis/clickhouse/",
       "facts": [
        "from $0.3903 per unit",
        "Free tier"
       ]
      },
      {
       "name": "Neon",
       "why": "Pick Neon when your app needs a managed Postgres database that many users write to at the same time.",
       "path": "apis/neon/",
       "facts": [
        "from $0.023 per GB-month Object",
        "Free tier",
        "Official MCP"
       ]
      },
      {
       "name": "Turso",
       "why": "Pick Turso when you want SQLite-compatible databases in the cloud, including many small per-user databases.",
       "path": "apis/turso/",
       "facts": [
        "See its page",
        "No free tier"
       ]
      }
     ],
     "more": "All databases and backends APIs",
     "more_path": "apis/backend-db/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use DuckDB to analyze data/orders.csv: pin duckdb==2.0.0, query the file directly with SQL from Python, use con.execute() when I need fetchone(), and keep the database file on a local disk, not a network share."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Install the Python package (Python 3.11 or newer), or npm install @duckdb/node-api for Node.js.",
       "code": "pip install duckdb",
       "src": "https://duckdb.org/docs/2.0/clients/python/overview.html"
      },
      {
       "text": "Run a query; this one uses an in-memory database inside your program.",
       "code": "import duckdb\n\nduckdb.sql(\"SELECT 42\").show()",
       "src": "https://duckdb.org/docs/2.0/clients/python/overview.html"
      },
      {
       "text": "Query a file by naming it in FROM (example from the official quickstart).",
       "code": "SELECT product, sum(quantity * price) AS revenue\nFROM read_csv('sales.csv')\nGROUP BY product\nORDER BY revenue DESC;",
       "src": "https://duckdb.org/docs/2.0/quickstart.html"
      }
     ]
    },
    {
     "t": "h3",
     "text": "First request"
    },
    {
     "t": "tabs",
     "label": "First request",
     "items": [
      {
       "tab": "Request",
       "code": "SELECT product, sum(quantity * price) AS revenue\nFROM read_csv('sales.csv')\nGROUP BY product\nORDER BY revenue DESC;",
       "intro": "DuckDB is a library, not a hosted API; this is the smallest official example (CLI quickstart, run on a three-line sales.csv). The same SQL works from Python with duckdb.sql(...)."
      },
      {
       "tab": "Response",
       "code": "The result contains Notebook with revenue of 15.00 and Pencil with revenue of 4.50."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "Calling fetchone() or fetchmany() on the result of duckdb.sql() or con.sql() in DuckDB 2.0.",
       "fix": "Use con.execute(query).fetchone(), or rel.limit(1).fetchall() on a relation.",
       "why": "In 2.0 a relation keeps no result between calls; our demo hit \"Relations no longer have fetchone()\" before switching to con.execute()."
      },
      {
       "dont": "Running CREATE TABLE or INSERT through duckdb.sql() and expecting it to run once.",
       "fix": "Use duckdb.execute() (or con.execute()) for statements that change data.",
       "why": "duckdb.sql() returns a lazy relation that runs again each time it is read."
      },
      {
       "dont": "Opening the same .duckdb file for writing from two processes, for example two web server workers.",
       "fix": "Write from one process and open others read-only, or use the Quack protocol or DuckLake for several writers.",
       "why": "Read-write mode allows one process; others get a lock error."
      },
      {
       "dont": "Keeping a read-write database file on a network drive (NAS) or a shared folder.",
       "fix": "Keep the file on a local disk (SSD) of the machine that writes it.",
       "why": "The DuckDB team strongly advises against it because of slow, hard-to-debug failures."
      },
      {
       "dont": "Writing a database with DuckDB 2.0 and opening it with an older DuckDB 1.x tool.",
       "fix": "Upgrade every tool that opens the file to 2.0, or write it with an explicit older storage version.",
       "why": "Versions before 2.0 cannot read 2.0 database files by default."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Do I need to run a database server?",
       "a": "No. DuckDB runs inside your program; there is no server software to install or maintain.",
       "evidence": {
        "url": "https://duckdb.org/why_duckdb",
        "quote": "For DuckDB, there is no DBMS server software to install, update, and maintain."
       }
      },
      {
       "q": "Is it only an in-memory database?",
       "a": "No. It can work in memory, and it can also save everything in a single database file on disk.",
       "evidence": {
        "url": "https://duckdb.org/faq",
        "quote": "DuckDB supports persistent storage and stores the database as a single file, which includes all tables, views, indexes, macros, etc."
       }
      },
      {
       "q": "Can several programs write to the same file?",
       "a": "Not directly. One process writes; for several writers the docs point to the Quack remote protocol or the DuckLake format.",
       "evidence": {
        "url": "https://duckdb.org/docs/2.0/connect/concurrency.html",
        "quote": "Writing to DuckDB's native database format from multiple processes is supported through the Quack remote protocol"
       }
      },
      {
       "q": "Will an older DuckDB open a file made by 2.0?",
       "a": "Not by default. Versions before 2.0 cannot read 2.0 files unless they were written with an explicit storage version.",
       "evidence": {
        "url": "https://duckdb.org/faq",
        "quote": "Note that DuckDB versions before 2.0 cannot read database files created by DuckDB 2.0 unless they were written with an explicit storage version"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "DuckDB Foundation / DuckDB Labs"
  ],
  [
   "Category",
   "Databases and backends"
  ],
  [
   "Price",
   "Free (open source)"
  ],
  [
   "Official SDK",
   "npm @duckdb/node-api, PyPI duckdb"
  ],
  [
   "Latest SDK",
   "2.0.0 on npm"
  ],
  [
   "Agent check",
   "3 of 6"
  ],
  [
   "Pricing checked",
   "Oct 10, 2026"
  ]
 ],
 "good": [
  "There is no DuckDB account, key or monthly bill; it is a library you install in your project.",
  "Only one program at a time can change a database file; several programs may read it in read-only mode.",
  "It runs on one machine and grows by using more memory and processor cores, not by adding servers."
 ],
 "checked_line": "Read by AgentGid from 26 official pages, card checked Nov 10, 2026; usage numbers update daily."
}