{"data":{"billing":{"currency":"USD","mode":"rules","parameters":[],"policy_version":2,"sale":{"addons":[],"base_price_micro_usd":"0","max_cost_micro_usd":"2000","quantities":[{"id":"upstream_credits","label":"Actual API.SH credits consumed","max_quantity":"1","measure":"value","pointer":"/credits_used","price_micro_usd":"2000","quantity_scale":0,"source":"response","unit":"credit","unit_quantity":"1"}],"rounding":"ceil","variants":[]}},"capabilityId":"9763fe97-364b-4836-9f32-ea2abb032e78","catalogType":"api","categories":["developer","data"],"dataPlatform":"hugging-face","dataPlatformLogoUrl":"https://api.sh/logos/hugging-face.png","dataPlatformTranslations":{},"dataProduct":"developer-resources","description":"Get Hugging Face Repo File Tree data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as id, output, and retrieve structured data including repository identifier, total file count reported, file size in bytes, download url, and next cursor to estimate storage and bandwidth upfront, locate specific export formats, and check file security and provenance.","descriptionTranslations":{"ar":"افحص شجرة الملفات لأي مستودع نموذج أو بيانات أو Space عام على Hugging Face عبر OpenAny REST لتدقيق أحجام الملفات وتحديد ملفات ONNX أو GGUF والتحقق من روابط التنزيل. حدّد معرّف المستودع أو رابط Hub والنوع والمراجعة ومسار المجلد والبحث التكراري مع التصفح بالمؤشر بصيغة JSON.","ja":"OpenAny REST で Hugging Face の公開モデル・データセット・Space リポジトリのファイルツリーを取得し、チェックポイントサイズ確認や ONNX/GGUF 探索、ダウンロード URL 検証に活用できます。リビジョン・フォルダパス・再帰指定とカーソルページングに対応しています。","zh":"通过 OpenAny REST 查看任意 Hugging Face 模型、数据集或 Space 公开仓库的文件树，用于审计权重文件大小、定位 ONNX 或 GGUF 产物并核验下载链接。指定仓库 ID 或 Hub 链接以及可选类型、修订版本、子目录路径与递归开关并配合游标分页，即可获取路径、大小、LFS 标记和最近提交信息。"},"effectContentHtml":"","executionMode":"sync","id":"8da07f3c-1178-433c-8b79-32bc7b25501e","includedContentHtml":"","inputs":[{"description":"Repo id (owner/name) or huggingface.co link.","location":"query","name":"id","nullable":false,"required":true,"type":"string"},{"description":"Repo type (default model; taken from a pasted link).","enum_values":["model","dataset","space"],"location":"query","name":"type","nullable":false,"required":false,"type":"string"},{"description":"Branch, tag or commit (default main).","location":"query","name":"revision","nullable":false,"required":false,"type":"string"},{"description":"Only this folder, e.g. onnx.","location":"query","name":"path","nullable":false,"required":false,"type":"string"},{"description":"Include sub-folders (default true).","enum_values":["true","false"],"location":"query","name":"recursive","nullable":false,"required":false,"type":"string"},{"description":"next_cursor from the previous page.","location":"query","name":"cursor","nullable":false,"required":false,"type":"string"},{"description":"0 leaves out the bulky `raw` source blocks (often 10-30x smaller).","enum_values":["0","1"],"location":"query","name":"raw","nullable":false,"required":false,"type":"string"},{"description":"Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.","location":"query","name":"fields","nullable":false,"required":false,"type":"string"},{"description":"1 skips the 24-hour cache and fetches live.","enum_values":["1"],"location":"query","name":"fresh","nullable":false,"required":false,"type":"string"},{"description":"JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON exports are not exposed.","enum_values":["json"],"location":"query","name":"output","nullable":false,"required":false,"type":"string"},{"description":"Native CSV/NDJSON record selector; it has no effect on this JSON-only product.","location":"query","name":"records","nullable":false,"required":false,"type":"string"}],"logoUrl":"https://api.sh/logos/hugging-face.png","method":"GET","name":"Hugging Face repository file tree API","nameTranslations":{},"overviewHtml":"\u003ch2\u003eHugging Face Repo File Tree API\u003c/h2\u003e\n\u003cp\u003ePass required id (owner/name or huggingface.co link) with optional type (default model), revision (branch, tag or commit, default main), path (subfolder such as onnx), recursive (default true) and cursor. Each entry exposes path, type, byte size, LFS/security flags, last_commit and direct download_url.\u003c/p\u003e\n\u003ch2\u003eQuick Facts\u003c/h2\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eFact\u003c/th\u003e\n\u003cth\u003eValue\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003eAccess\u003c/td\u003e\n\u003ctd\u003eOpenAny REST\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAuthentication\u003c/td\u003e\n\u003ctd\u003eOpenAny API key in the Authorization header\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCore inputs\u003c/td\u003e\n\u003ctd\u003eRequired query: id (owner/name or Hub link). Optional type (default model), revision (default main), path (folder), recursive (default true), cursor, raw=0, fields and fresh=1.\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSelected implementation\u003c/td\u003e\n\u003ctd\u003eapish · Hugging Face repository file tree API\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eBilling\u003c/td\u003e\n\u003ctd\u003eSee the pricing area for the selected implementation and request options\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2\u003eWhat You Can Build\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eEstimate storage and bandwidth upfront\u003c/strong\u003e: Sum items[].size or read total_size before pulling multi-gigabyte safetensors or Parquet shards.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eLocate specific export formats\u003c/strong\u003e: Pass path=onnx or inspect items[].path and items[].lfs to find quantized weights or dataset splits.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eCheck file security and provenance\u003c/strong\u003e: Inspect items[].security, items[].oid and items[].last_commit before integrating artifacts.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2\u003eReturned Data\u003c/h2\u003e\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eField\u003c/th\u003e\n\u003cth\u003eMeaning\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eid\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eRepository identifier (owner/name)\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003etype\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eRepository type: model, dataset or space\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003erevision\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eBranch, tag or commit revision listed\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003efiles_count\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eTotal file count reported\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003etotal_size\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eAggregate byte size of listed files\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].path\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eRepository-relative file or directory path\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].type\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eEntry kind such as file or directory\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].size\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eFile size in bytes\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eitems[].download_url\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eDirect download link for the file at this revision\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003enext_cursor\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003eOpaque cursor for the next page, or null on the last page\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003ch2\u003eQuick Start\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eSet OPENANY_API_KEY to your OpenAny API key.\u003c/li\u003e\n\u003cli\u003eReview the selected implementation and pricing, then adapt the request below to your target.\u003c/li\u003e\n\u003cli\u003eCheck the HTTP response and business result before reading optional fields.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cpre\u003e\u003ccode class=\"language-bash\"\u003ecurl --request GET --get \\\n  https://api.openany.si/v1/agent-apis/apish/huggingface/v1/model/files \\\n  -H \u0026#34;Authorization: Bearer ${OPENANY_API_KEY}\u0026#34; \\\n  --data-urlencode id=openai-community/gpt2 \\\n  --data-urlencode output=json\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch2\u003eRequest and Response Examples\u003c/h2\u003e\n\u003cp\u003eThe response example is a documentation reference and may be abbreviated. The documented request is a calling template; use the published contract and returned response for the selected implementation.\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://openany.si/api/v1/agent-apis/8da07f3c-1178-433c-8b79-32bc7b25501e\"\u003ePublished Hugging Face Repo File Tree API implementation contract\u003c/a\u003e.\u003c/p\u003e\n\u003ch2\u003ePricing and Billing\u003c/h2\u003e\n\u003cp\u003eThe pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service\u0026#39;s public availability does not determine OpenAny billing.\u003c/p\u003e\n\u003ch2\u003eFrequently Asked Questions\u003c/h2\u003e\n\u003ch3\u003eCan I list files in datasets and Spaces as well as models?\u003c/h3\u003e\n\u003cp\u003eYes. Set type to dataset or space, or pass a full huggingface.co URL in id to infer the repository type.\u003c/p\u003e\n\u003ch3\u003eHow do I restrict the listing to a single folder?\u003c/h3\u003e\n\u003cp\u003ePass the folder path in path (for example onnx), and set recursive=false if you do not want nested subdirectories.\u003c/p\u003e\n\u003ch3\u003eCan I inspect files at a specific tag, branch or commit hash?\u003c/h3\u003e\n\u003cp\u003eYes. Pass the branch, tag or commit hash in revision (defaults to main).\u003c/p\u003e\n\u003ch3\u003eDoes this API download the actual file bytes?\u003c/h3\u003e\n\u003cp\u003eNo. It returns file metadata, sizes, hashes and direct download_url links in JSON.\u003c/p\u003e\n\u003ch3\u003eHow do I paginate repositories with many files?\u003c/h3\u003e\n\u003cp\u003ePass the returned next_cursor into cursor on subsequent calls until next_cursor is null.\u003c/p\u003e\n\u003ch3\u003eHow do caching and field selection work?\u003c/h3\u003e\n\u003cp\u003eOutput is JSON only. Pass fresh=1 to skip the 24-hour cache, raw=0 to omit raw blocks, or fields to select specific keys.\u003c/p\u003e\n\u003ch2\u003eRelated APIs\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/hugging-face/hugging-face-repository-commit-history-api\"\u003eHugging Face Repo Commit History API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/hugging-face/hugging-face-model-details-api\"\u003eHugging Face Model Details API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://openany.si/market/apis/hugging-face/hugging-face-dataset-details-api\"\u003eHugging Face Dataset Details API\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","pagePath":"/markets/apis/hugging-face/hugging-face-repository-file-tree-api?offering=8da07f3c-1178-433c-8b79-32bc7b25501e","providerId":"apish","publicPath":"/v1/agent-apis/apish/huggingface/v1/model/files","requestContentType":"none","revision":3,"samples":[{"http_status":200,"name":"Official example · Official documentation response · Supplier-tr","request":{"body":null,"headers":{},"path":{},"query":{"id":"openai-community/gpt2","output":"json"}},"response_body":{"cached":false,"count":27,"credits_used":1,"files_count":26,"id":"openai-community/gpt2","items":[{"download_url":null,"last_commit":{"date":"2023-06-30T02:19:43.000Z","id":"11c5a3d5811f50298f278a704980280950aedb10","title":"Adding ONNX file of this model (#60)"},"lfs":null,"oid":"d03ec5ec179df58241d27d55f92a674f5f44197f","path":"onnx","security":null,"size":0,"type":"directory","url":"https://huggingface.co/openai-community/gpt2/tree/main/onnx","xet_hash":null},{"download_url":"https://huggingface.co/openai-community/gpt2/resolve/main/.gitattributes","last_commit":{"date":"2022-09-29T15:22:02.000Z","id":"909a290700bd99135e67c64eefc166960b67cfd2","title":"Convert weights to .safetensors (#6)"},"lfs":null,"oid":"602b71f15d40ed68c5f96330e3f3175a76a32126","path":".gitattributes","security":null,"size":445,"type":"file","url":"https://huggingface.co/openai-community/gpt2/blob/main/.gitattributes","xet_hash":null},"… 25 more"],"next_cursor":null,"path":null,"revision":"main","total_size":5632417295,"type":"model"}}],"seoDescription":"Get Hugging Face Repo File Tree data via REST or MCP powered by Apish. Pay per call, no subscription. Built to estimate storage and bandwidth upfront.","updatedAt":"2026-12-03T02:43:37.475Z","usageInstructionsHtml":""}}