# Cheerio > Cheerio is a fast, flexible, and elegant Node.js library for parsing and manipulating > HTML and XML with a jQuery-compatible API. It parses markup into a traversable, > manipulable DOM-like structure and serializes it back to markup. It is MIT licensed, > distributed as the `cheerio` npm package, and maintained under the cheeriojs GitHub > organization. Cheerio is a LIBRARY, not a hosted service: it has no HTTP API, no base > URL, no API keys, no rate limits and no pricing. It never executes scripts, evaluates > expressions, or touches the network — the one exception being `fromURL`, which makes > the request you ask it to make. Generated by API Evangelist from the project's own published surface on 2026-09-05. No OpenAPI exists for Cheerio and none is published — see the note at the end. ## Install - [cheerio on npm](https://www.npmjs.com/package/cheerio): `npm install cheerio` — latest 1.2.0, published 2026-01-23, MIT - [cheerio/slim](https://cheerio.js.org/docs/advanced/configuring-cheerio/): htmlparser2-only export that leaves parse5 out of the bundle, for browsers - Runtime: Node.js >= 18.17; a browser build ships in the package; TypeScript types are bundled ## Loading documents - [Loading Documents](https://cheerio.js.org/docs/basics/loading/): which entrypoint to use for which input - `load(string)` — you already have the markup as a string. The only method available in the browser. - `loadBuffer(Buffer)` — raw bytes, unknown encoding; runs the HTML encoding sniffing algorithm. - `stringStream(stream)` — streaming decoded text, known encoding. - `decodeStream(stream)` — streaming raw bytes, unknown encoding. - `fromURL(url)` — Cheerio fetches the page for you. Node.js only. ## Core documentation - [Introduction](https://cheerio.js.org/docs/intro): what Cheerio is and is not - [Selecting Elements](https://cheerio.js.org/docs/basics/selecting/): CSS selectors, the same syntax as `document.querySelectorAll`, plus jQuery extensions - [Traversing](https://cheerio.js.org/docs/basics/traversing/): moving around the tree - [Manipulation](https://cheerio.js.org/docs/basics/manipulation/): changing attributes, text and markup - [Extract](https://cheerio.js.org/docs/basics/extract/): pulling structured data out of a document - [Troubleshooting](https://cheerio.js.org/docs/basics/troubleshooting/) - [Configuring Cheerio](https://cheerio.js.org/docs/advanced/configuring-cheerio/): parse5 vs htmlparser2, fragment mode, XML mode - [Extending Cheerio](https://cheerio.js.org/docs/advanced/extending-cheerio/): plugins - [Security](https://cheerio.js.org/docs/advanced/security/): what Cheerio does and does not protect you from ## API reference - [API index](https://cheerio.js.org/docs/api/) - [CheerioAPI interface](https://cheerio.js.org/docs/api/interfaces/cheerioapi/) - [Cheerio class](https://cheerio.js.org/docs/api/classes/cheerio/) - [CheerioOptions](https://cheerio.js.org/docs/api/interfaces/cheeriooptions/) - [Htmlparser2Options](https://cheerio.js.org/docs/api/interfaces/htmlparser2options/) - [load](https://cheerio.js.org/docs/api/variables/load/), [fromURL](https://cheerio.js.org/docs/api/functions/fromurl/), [loadBuffer](https://cheerio.js.org/docs/api/functions/loadbuffer/), [decodeStream](https://cheerio.js.org/docs/api/functions/decodestream/), [stringStream](https://cheerio.js.org/docs/api/functions/stringstream/), [contains](https://cheerio.js.org/docs/api/functions/contains/), [merge](https://cheerio.js.org/docs/api/functions/merge/) ## Rules an agent must follow - Cheerio is NOT a sanitizer. `$.html()` output is exactly as trustworthy as its input: `