BASE

Cheerio

Cheerio

Backend / API library · Free

An HTML/XML parser and selector API for Node.js: it extracts data and transforms documents without running a full browser.

Also known as: cheeriojs/cheerio; cheerio; cheeriojs

Resource illustration: Cheerio

Open resource ↗

What you can use for free

Code and local use under MIT.

Paid features and costs

Computing resources, self-hosting, and external services are paid for separately if used.

Access and limitations

Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.

Use cases

  • Extract data from HTML without a browser
  • Read/transform selected nodes and check the structured result

Example workflow

A possible workflow; this is not a report of hands-on testing.

Extract data from HTML without a browser.

Before you start

  • A data contract or HTTP workflow.
  • A project with a supported runtime.

Steps

  1. Prepare an HTML/XML sample and selectors for the required elements.
  2. Read/transform selected nodes and check the structured result.
  3. Add error handling and an integration check of the result.

Check your result

  • Invalid and missing data are handled predictably.
  • Types and the actual response agree; errors are not hidden.

Choosing Cheerio

Extract data from HTML without a browser

Choose this when

  • Extract data from HTML without a browser
  • Read/transform selected nodes and check the structured result

Requirements

  • HTML/XML to parse and Node.js; the current introductory documentation specifies Node.js 22.19 or later.

Things to consider

  • Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.
  • Terms of use: MIT for the code; dependencies have separate licenses.
  • Cheerio does not replace browser automation and cannot reproduce client interactions itself.

Frequently asked questions

What can you use for free in Cheerio?

Code and local use under MIT.

What additional costs might arise with Cheerio?

Computing resources, self-hosting, and external services are paid for separately if used.

What terms of use matter for Cheerio?

MIT for the code; dependencies have separate licenses.

How do you get started with Cheerio?

Prepare an HTML/XML sample and selectors for the required elements. Read/transform selected nodes and check the structured result. Add error handling and an integration check of the result.

Why doesn't Cheerio see content generated by a site's JavaScript?

Cheerio parses HTML/XML and provides an API for selecting and modifying nodes. It does not execute JavaScript, render CSS, or load external resources like a browser. A SPA's client-rendered result is therefore absent until you obtain the rendered markup another way. Puppeteer or Playwright can perform browser execution.

License

MIT for the code; dependencies have separate licenses.

MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.

License terms

Technologies and topics

  • Cheerio
  • API
  • Development

Sources

Other resources