Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Cheerio

by Cheerio (open source project)

Read and change web page code in JavaScript.

Scraping and crawling

WebsiteGitHub

1. Price

No free tier on the pricing page. As reported on the official pricing page, checked Oct 10, 2026.

cheerio.js.org

Checked against the maker's official pages, pricing on Oct 10, 2026. Tap a verdict to see its source.How we checkedReport an error

What Cheerio does

Cheerio is a free, open-source code library, not an online service. Your app or script gives it the code of a web page and gets back exactly the parts it asks for, such as product names, prices or links. It can also change that page code, and it runs inside your own program, with no account and no key.

  • Cheerio is one of 25 APIs in the Scraping and crawling category on AgentGid.
  • It is one of 20 that can be started for free.
  • 12 of them ship an official MCP server; Cheerio does not.
  • Its official SDK is the 1st most downloaded in the category (37.2M a week).

What people build with it

Pull prices and names from a page

Read a shop or catalog page your script has downloaded and get each product's name, price and link as a neat list.

Turn repeated blocks into records

A page lists many similar blocks, like releases, jobs or reviews; describe one block once and get every block back as a record.

Change page code before saving it

Edit an HTML template or e-mail on the server, for example replace a heading or add a class, then save the result.

Read a sitemap or feed

Load an XML file such as a sitemap or news feed from a web address and list its entries.

Clean page text for an AI assistant Idea

Take only the readable text of an article, without scripts and styles, before sending it to a chat model to summarize.

Check your own pages before publishing Idea

In a build step, scan every generated page for images without alt text or pages without a title.

Cheerio popularity

37.4M
SDK downloads a week
+35.8% on the 4-week average
305
public agent repos use its SDK
30.6K
GitHub stars, cheeriojs/cheerio
SDK downloads per weeknpm cheerio 37,434,618

SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.

Pricing

Free tier

None

Cheapest plan

No monthly plan

Usage price

—

Plans

Library, not a hosted API: free to use, does not fetch or render JavaScript itself.

As reported on the official pricing page, checked Oct 10, 2026. Prices change: confirm before you buy.

Key and access

How it signs in

None. It is a library that runs in your own code; there is no account, key or Cheerio service.

Environment variable
none
Safe in browser code
Yes
Card at sign-up

No

Commercial use and your data

Free for any use, including paid products and client work, under the MIT license. Keep the copyright and license notice with copies of the code; no visible credit is needed.

In a paid app
Yes

MIT allows use in paid products free of charge.

“Permission is hereby granted, free of charge, to any person obtaining a copy of this software” source

inside-app-bundle
With conditions

Shipping the code inside your app is allowed if the MIT copyright and permission notice stays with it.

“The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.” source

client-work
Yes

MIT places no limit on who you build for.

“Permission is hereby granted, free of charge, to any person obtaining a copy of this software” source

Errors to handle

Error: Unknown pseudo-class :focus

The selector uses a browser-only state (:focus, :target, :lang) that Cheerio does not support.

Remove that part of the selector; match on structure, classes or data- attributes instead.

ResponseError (fromURL)

The website answered with a non-2xx status, such as 404 or 500.

Read the status code on the error; retry later for 5xx, fix the address for 404.

RangeError (fromURL)

The address returned something that is not HTML or XML, such as a PDF.

Check the address; handle other file types with another tool.

method must be a string

requestOptions was passed to fromURL without a method.

Add method: 'GET' to requestOptions.

Use it from an agent

Our agent check

2 of 6: llms.txt no, OpenAPI no, SDK yes, MCP no, status page no, AI assistants allowed yes

Checked Nov 13, 2026.

MCP server

None found

npm
npm install cheerio

Alternatives

Cheerio This page

Free (open source)No free tier

Firecrawl

Pick Firecrawl when you want a hosted service that also opens script-heavy pages and returns clean text for AI; our catalog lists about $5 per 1,000 pages (list price on 2026-11-10).

See its pageNo free tier

Crawl4AI

Pick Crawl4AI for an open-source crawler that renders pages and writes AI-friendly text, run yourself or as a hosted service.

$0.5 / 1k requestsFree tierOfficial MCP

Apify

Pick Apify when you want ready-made scrapers for popular sites plus hosting and proxies, instead of writing selectors.

See its pageNo free tier

All scraping and crawling APIs

Get started

Tell your AI assistant

“Use cheerio 1.2.0 on the server: load the HTML, read the products with $.extract into a list of { name, price, link }, set baseURI so links are absolute, and never pass a user-typed URL or selector straight in.”

  1. Add Cheerio to a Node.js project.

    npm install cheerio

    From cheerio.js.org/docs/intro

  2. Load the page code with load, then select elements with CSS selectors, like in jQuery.

    import * as cheerio from 'cheerio';
    const $ = cheerio.load('<h2 class="title">Hello world</h2>');
    $('h2.title').text(); // "Hello world"

    From cheerio.js.org/docs/intro

  3. To have Cheerio download the page itself, use fromURL and await it (Node.js only).

    import * as cheerio from 'cheerio';
    const $ = await cheerio.fromURL('https://example.com');

    From cheerio.js.org/docs/basics/loading

First request

Cheerio is a library, not a hosted service; this is the smallest example from its home page and README, and our demo ran the same calls.

import * as cheerio from 'cheerio';
const $ = cheerio.load('<h2 class="title">Hello world</h2>');

$('h2.title').text('Hello there!');
$('h2').addClass('welcome');

$.html();

Mistakes to avoid

Using Cheerio on a site whose content is drawn by React or Vue in the browser, then reading empty results as "no data".
Check $.html() first; if you see an empty root div and a script bundle, render the page with Playwright or Puppeteer and pass that HTML to Cheerio.

Cheerio does not run scripts, so content built in the browser is not in the HTML it got.

$('#greeting').html(`Hello, ${name}`) with text typed by a user
$('#greeting').text(`Hello, ${name}`)

html() and other insert methods parse their input as markup, so user text can inject tags; text() escapes it.

$(`[data-id="${id}"]`) with an id from user input or scraped data
$('[data-id]').filter((_, el) => $(el).attr('data-id') === id)

A quote in the value breaks out of the selector; Cheerio has no CSS.escape.

cheerio.fromURL(url, { requestOptions: { headers: { ... } } })
Always include method: 'GET' in requestOptions, and repeat the Accept header if you set headers.

requestOptions has no default method, and your headers replace Cheerio's defaults instead of adding to them.

$('li').text() to get each item
$('li').map((i, el) => $(el).text()).get()

text() on many elements joins them into one run-on string with no separator.

Questions

Do I need an account or a key?

No. Cheerio is a code library you install; nothing is sent to a Cheerio service.

Why is my selection empty on some sites?

The content is probably built by the page's scripts, which Cheerio does not run. Check the HTML you received; for such pages use Puppeteer or Playwright.

Can I use it in a commercial product?

Yes. It is MIT licensed; keep the license notice with copies of the code.

Does it work in the browser?

Yes, with the load function only; fetching and stream loaders need Node.js.