---
title: "Get folder size"
method: GET
path: "/api/datasets/{namespace}/{repo}/treesize/{rev}/{path}"
tags: ["datasets"]
---

# Get folder size

`GET /api/datasets/{namespace}/{repo}/treesize/{rev}/{path}`

Get the total size of a repository at a given revision, optionally under a specific subpath. Returns the total size in bytes of all files under the specified path (recursively). If a file is stored via Xet/LFS, the LFS file size is used.

## Path parameters

- `namespace` string, required
- `repo` string, required
- `rev` string, required
- `path` string, required — Wildcard path parameter

## Response `200`

Total size of a repository at a given revision, under the given path

- object
  - `path` string, required — The normalized path of the subtree, starting with a slash
  - `size` integer, required — Total size in bytes of all files under the subtree

---

[API](https://skmtc.dev/huggingface/apis/hub-api-endpoints.md) · [All operations](https://skmtc.dev/huggingface/apis/hub-api-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/huggingface/hub-api-endpoints/revisions/e1c551f50478/schema)
