> **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/repos-repotype-owner-name-files>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/hugging-face/repos-repotype-owner-name-files.mdx>

---

# Hugging Face Files API

Walk a repository tree with file sizes, git ids, large-file details and optional last commits.

`GET /v1/hugging-face/repos/{repoType}/{owner}/{name}/files` returns `repo`, `reason`, a page of `files` and a `page` block. Each entry has `path`, `type` (`file` or `directory`), `sizeBytes`, `blobId`, `lfs` (large-file details or null) and `lastCommit`.

Use `path` to list below a folder and `recursive=true` to walk everything. `includeLastCommit=true` adds the commit that touched each file, and pages are then limited to 100 entries. `revision`, `limit` up to 1000 and `cursor` control the listing. When nothing is found, `reason` says whether the repository or only the folder is missing; `repo` is still present when the repository exists.

## Request

- **Endpoint:** `GET /v1/hugging-face/repos/{repoType}/{owner}/{name}/files`
- **Credits:** 1 credit
Failed requests are free
- **Input:** by repository
- **Full reference:** [docs](https://www.socialfetch.dev/docs/api/v1/hugging-face/repos/repotype/owner/name/files/get)
- **Platform page:** [/platforms/hugging-face](https://www.socialfetch.dev/platforms/hugging-face)

## FAQ

### Why is my limit refused when includeLastCommit=true?

The platform refuses a page of more than 100 files with their last commits, so the request is refused with a 400. Use 100 or less.

### Does lfs tell me whether a file is too large to read?

lfs is present when the file is stored in large-file storage. It carries sha256, sizeBytes and pointerSize.

### Why is repo present when nothing was found?

reason=path_not_found means the repository exists and the requested folder does not. reason=repo_not_found means the repository does not exist or is private, and repo is null.

### Can I list one folder?

Yes. Pass path as the folder from the repository root. Add recursive=true to include everything below it.

### How much does a file listing 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.
