{
 "kind": "tool",
 "slug": "cheerio",
 "path": "tools/cheerio/",
 "name": "Cheerio",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Scraping, browsers and parsing",
   "tools/scraping-parsing/"
  ]
 ],
 "lead": "jQuery-like syntax for parsing and manipulating HTML/XML with server-side speed.",
 "chips": [
  {
   "label": "Scraping, browsers and parsing",
   "path": "tools/scraping-parsing/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install cheerio"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/cheeriojs/cheerio"
  },
  {
   "label": "Website",
   "href": "https://cheerio.js.org/"
  },
  {
   "label": "API page",
   "path": "apis/cheerio/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/cheeriojs/cheerio"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Jan 23, 2026. ",
   "src": "https://github.com/cheeriojs/cheerio"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "76 projects",
   "status": "info",
   "sub": "#6 of 141 in its category",
   "note": "Dependency in 76 public GitHub projects set up for AI coding agents that we scanned (1.2%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Cheerio does",
   "parts": [
    {
     "t": "prose",
     "text": "Cheerio gives you jQuery's selector-and-chain API over an HTML or XML string you load yourself, with no browser DOM underneath."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Cheerio popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "78",
       "of": "/ 100",
       "l": "Gid Score, #132 overall"
      },
      {
       "n": "37.4M",
       "l": "downloads a week, npm"
      },
      {
       "n": "30.6K",
       "l": "GitHub stars"
      },
      {
       "n": "76",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Cheerio is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Cheerio is a dependency in 76 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.6% of the 4,867 JavaScript/TypeScript ones), #6 of 141 in scraping, browsers and parsing.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 313; those are left out of every share on this page.",
      "The most used alternative in our scan is Puppeteer (86 projects).",
      "Projects that use it most often also use Axios (44.7%), dotenv (47.4%), TypeScript (81.6%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "37 projects, 1.2%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "33 projects, 1.0%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "32 projects, 1.3%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "8 projects, 1.7%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "8 projects, 2.3%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "7 projects, 2.5%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "5 projects, 1.5%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 44.7% of its projects",
       "v": "Axios",
       "path": "tools/axios/"
      },
      {
       "l": "In 47.4% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 81.6% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 59.2% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 55.3% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 56.6% of its projects",
       "v": "ESLint",
       "path": "tools/eslint/"
      },
      {
       "l": "In 36.8% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Cheerio in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "jQuery calls work on server-side HTML",
       "v": "The API is a subset of core jQuery. Selectors like <code>$('ul .pear')</code> and methods like <code>.text()</code>, <code>.attr()</code> and <code>.addClass()</code> carry over. The maintainers say they removed the DOM inconsistencies and browser cruft."
      },
      {
       "l": "Two parsers to choose from",
       "v": "Cheerio parses HTML with parse5 by default. The README says it can optionally use htmlparser2, which it calls \"forgiving\"."
      },
      {
       "l": "HTML and XML, browser and server",
       "v": "The README says it can handle \"nearly any\" HTML or XML document and works in both environments."
      },
      {
       "l": "Speed comes from a simpler DOM model",
       "v": "The maintainers say a \"very simple, consistent DOM model\" makes parsing, manipulating and rendering efficient. A screencast linked from the README claims Cheerio is faster than JSDOM + jQuery. No figures are given."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Not all of jQuery",
       "v": "Cheerio implements only a subset of core jQuery. Do not assume every jQuery method you know is present."
      },
      {
       "l": "There is no ambient document",
       "v": "jQuery works on the page's built-in DOM. Cheerio has none, so every document must be passed to <code>cheerio.load()</code> first."
      },
      {
       "l": "Fragments come back wrapped",
       "v": "The README examples show that loading a fragment and calling <code>$.html()</code> returns it wrapped in <code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;</code>. For a single element's markup, the README uses <code>.prop('outerHTML')</code> instead."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Load, select, modify, render"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Js",
       "code": "import * as cheerio from 'cheerio';\nconst $ = cheerio.load('<h2 class=\"title\">Hello world</h2>');\n\n$('h2.title').text('Hello there!');\n$('h2').addClass('welcome');\n\n$.html();\n//=> <html><head></head><body><h2 class=\"title welcome\">Hello there!</h2></body></html>"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Cheerio",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/cheeriojs",
        "GitHub Sponsors: https://github.com/fb55",
        "Open Collective: https://opencollective.com/cheerio",
        "Own page: https://github.com/cheeriojs/cheerio?sponsor=1",
        "4 GitHub sponsors"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "axios: HTTP client",
        "dotenv: Env variables",
        "zod: Schema validation",
        "express: Web server",
        "tailwindcss: Utility CSS",
        "tsx: Run TypeScript"
       ]
      },
      {
       "title": "More in Scraping, browsers and parsing",
       "path": "tools/scraping-parsing/",
       "items": [
        {
         "text": "Beautiful Soup",
         "path": "tools/beautifulsoup4/"
        },
        {
         "text": "Playwright Core",
         "path": "tools/playwright-core/"
        },
        {
         "text": "lxml",
         "path": "tools/lxml/"
        },
        {
         "text": "Playwright (Python)",
         "path": "tools/playwright/"
        },
        {
         "text": "fast-xml-parser",
         "path": "tools/fast-xml-parser/"
        },
        {
         "text": "jsonc-parser",
         "path": "tools/jsonc-parser/"
        },
        {
         "text": "Mozilla Readability",
         "path": "tools/mozilla-readability/"
        },
        {
         "text": "Puppeteer Core",
         "path": "tools/puppeteer-core/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Cheerio",
       "me": true,
       "facts": [
        "MIT",
        "Gid 78",
        "37.4M/wk"
       ]
      },
      {
       "name": "Puppeteer",
       "why": "Headless Chrome/Chromium automation for scraping, testing and screenshot generation.",
       "path": "tools/puppeteer/",
       "facts": [
        "Apache-2.0",
        "Gid 80",
        "16M/wk"
       ]
      },
      {
       "name": "linkedom",
       "why": "Lightweight DOM implementation using linked lists for Node.js.",
       "path": "tools/linkedom/",
       "facts": [
        "ISC",
        "Gid 62",
        "10.5M/wk"
       ]
      },
      {
       "name": "parse5",
       "why": "Fast, spec-compliant HTML parser and serializer for Node.js and browsers.",
       "path": "tools/parse5/",
       "facts": [
        "MIT",
        "Gid 66",
        "255M/wk"
       ]
      },
      {
       "name": "xml2js",
       "why": "XML to JavaScript object parser for handling XML data in applications.",
       "path": "tools/xml2js/",
       "facts": [
        "MIT",
        "Gid 66",
        "65.6M/wk"
       ]
      }
     ],
     "more": "Compare Cheerio with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install cheerio"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Cheerio\n- Import with `import * as cheerio from 'cheerio'` in ESM or TypeScript, and `const cheerio = require('cheerio')` elsewhere.\n- Always call `cheerio.load(html)` first. There is no implicit document like jQuery's.\n- Query with `$(selector, [context], [root])`. `context` scopes the search, as in `$('.apple', '#fruits')`.\n- Only a subset of core jQuery exists. Check the docs before using a jQuery method.\n- `$.html()` and `$.root().html()` render a full document with `<html><head><body>` added. Use `$(sel).prop('outerHTML')` for one element's markup.\n- Use `.text()` for text content. Rely only on the node properties the README lists: `tagName`, `parentNode`, `previousSibling`, `nextSibling`, `nodeValue`, `firstChild`, `childNodes`, `lastChild`.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm cheerio"
  ],
  [
   "Category",
   "Scraping, browsers and parsing"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "v1.2.0, January 23, 2026"
  ],
  [
   "On GitHub since",
   "October 2011"
  ],
  [
   "Gid Score",
   "78.2"
  ],
  [
   "Rank in category",
   "#6 of 141"
  ],
  [
   "GitHub",
   "cheeriojs/cheerio"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [
  "Used by Walmart, AfterShip, Sysco Labs, Scraper API, as listed by the source; we have not checked each one."
 ],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/cheeriojs.png"
}