Hugging Face

Search Hugging Face repository text

Search the text of Hugging Face READMEs and code files.

GET/v1/hugging-face/search/readmes
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
4
querystringrequiredquery

Search text.

min 1 chars · max 200 chars

typestringoptionalquery

Only this kind of repository.

one of: model, dataset, space

limitintegeroptionalquery

Items per page, 1-100. A page can hold fewer. Default: 20.

≥ 1 · ≤ 100

pageintegeroptionalquery

Page number (1-based), `limit` hits a page. Default: 1. At most 500 hits can be skipped, so deeper pages are not offered.

≥ 1

Response fields
22

Endpoint-specific response payload.

datalookupStatus
string

Whether the item was found.

one of: found, not_found

dataestimatedTotalHits
integernullable

Estimated number of matching files.

Matches on this page.

datahits[]repoId
string

Repository id, `owner/name`.

datahits[]type
string

Repository type.

one of: model, dataset, space

datahits[]url
string

Repository page URL.

datahits[]fileName
stringnullable

File that matched.

datahits[]isReadme
booleannullable

Whether the match is in the README.

datahits[]likes
integernullable

Likes on the repository.

datahits[]updatedAt
stringnullable

When the repository last changed (ISO-8601).

datahits[]tags
stringnullable

The repository's tags, comma-separated.

datahits[]snippet
stringnullable

Matching text, with the match wrapped in `**`: about 300 characters either side of the first match, with `…` where the file continues.

datahits[]line
integernullable

Line of the file where `snippet` starts. Null when unknown (only README hits carry it).

Pagination state. The search reaches at most 500 skipped hits plus one page.

datapagehasMore
boolean

Whether another page is available.

datapagenextPage
integernullable

Page number to pass as `page` for the next page; null on the last page.

datapagenextOffset
integernullable

Offset for the next page; null on the last page.

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/hugging-face/search/readmes?query=bert" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Text search page.