> **For coding agents and LLMs:** This is one Social Fetch marketing page (markdown export). For API orientation start with [`/llms.txt`](https://www.socialfetch.dev/llms.txt); for auth and crawl rules use [`/agents.txt`](https://www.socialfetch.dev/agents.txt); for every operation use [`/llms-endpoints.txt`](https://www.socialfetch.dev/llms-endpoints.txt).

## This page

- **On-site (HTML):** <https://www.socialfetch.dev/platforms/hugging-face/search-readmes>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/hugging-face/search-readmes.mdx>

---

# Hugging Face README Search API

Search the words inside repository files, mostly READMEs, with a matched snippet and the repository it came from.

`GET /v1/hugging-face/search/readmes` takes a required `query`, an optional `type` (`model`, `dataset` or `space`), `limit` up to 100 and a `page` number from 1. It returns `estimatedTotalHits`, `hits` and a `page` block.

Each hit has `repoId`, `type`, `url`, `fileName`, `isReadme`, `likes`, `updatedAt`, `tags`, `snippet` and `line`. The snippet holds about 300 characters either side of the first match, with the match wrapped in `**`. The deepest page starts after 500 skipped hits because the platform slows down for each one.

## Request

- **Endpoint:** `GET /v1/hugging-face/search/readmes`
- **Credits:** 1 credit
Failed requests are free
- **Input:** by keyword
- **Full reference:** [docs](https://www.socialfetch.dev/docs/api/v1/hugging-face/search/readmes/get)
- **Platform page:** [/platforms/hugging-face](https://www.socialfetch.dev/platforms/hugging-face)

## FAQ

### Why does the search stop after 500 skipped hits?

The platform takes longer for every hit it skips and gives up after about 12 seconds. A page that would start past hit 500 is refused with a 400 instead of waiting for that failure.

### How do I get the next page?

Pass `page.nextPage` as `page` while `page.hasMore` is true. `page.nextOffset` reports the hit the next page starts at.

### What does the snippet show?

About 300 characters either side of the first match, with the match in double asterisks and an ellipsis where the file continues.

### How much does a README search cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth. Each paginated page is a separate billed request.
