huggingface

A scraping guide for Hugging Face listings. Hugging Face is a platform that publishes machine-learning models, datasets, and interactive demo applications, with public JSON endpoints for these listings.

In plain words
What is it for?
Use it to retrieve models, datasets, or Spaces from Hugging Face. It covers listing filters, sorting, and cursor-based pagination through the public API.
Why use it?
It avoids parsing the HTML page when the same filtered and sorted data is available as JSON. The endpoints require no login for public listings and avoid the HTML page’s soft rate limit.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/agentcomputerai/torch/huggingface
Any agent
npx skills add AgentComputerAI/torch --skill huggingface
Clone the repo
git clone --depth 1 https://github.com/AgentComputerAI/torch

Made for: Claude Code, Codex.

Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,613 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00105 $0.01613
Opus 5 $0.00053 $0.00807
Sonnet 5 $0.00021 $0.00323
Haiku 4.5 $0.00011 $0.00161

Measured 2d ago against content hash 9f790732e877, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

huggingface scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Phase 0 (curl):** HTML returns 200 but the data lives in a hydration blob. Not worth parsing — instead checked `/api/models?pipeline_tag=text-generation&sort=trendingScore`. Got clean JSON. Done.
skills/sites/huggingface/SKILL.md · 142 lines

How it starts

The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hugging Face (huggingface.co)

The model/dataset/space listing HTML pages are server-rendered behind CloudFront but there is no reason to scrape them — Hugging Face ships a public JSON API that backs the same UI and accepts every URL filter verbatim. One-to-one parameter mapping, no auth, no rate-limit in practice (a soft ratelimit: "pages";q=100;w=300 is on the HTML routes, not /api).

Detection

Signal Value
CDN CloudFront (x-cache: ... cloudfront.net)
Framework SvelteKit (huggingface-moon)
Anti-bot None on /api/*. HTML pages have a soft page rate limit.
Auth Not required for public models/datasets/spaces.
robots.txt Allows /api/ crawling.

Architecture

Every listing URL https://huggingface.co/models?<filters> has a direct JSON twin at https://huggingface.co/api/models?<same filters>. The HTML page is just a SvelteKit shell that calls the same endpoint client-side.

  • Endpoint: https://huggingface.co/api/models
  • Filters map 1:1: pipeline_tag, library, language, license, other, search, author, filter.
  • Sort: sort=trendingScore|downloads|likes|createdAt|lastModified + direction=-1|1.
  • Page size: limit (max 100 observed, use 100).
  • Pagination: cursor-based via the Link response header (<...cursor=...>; rel="next"). Extract the cursor query param from that URL and pass it to the next request.

Also available:

  • /api/datasets — same shape, for /datasets listings.
  • /api/spaces — same shape, for /spaces listings.
  • /api/models/<repo_id> — full model card metadata for a single repo.

Strategy used

  • Phase 0 (curl): HTML returns 200 but the data lives in a hydration blob. Not worth parsing — instead checked /api/models?pipeline_tag=text-generation&sort=trendingScore. Got clean JSON. Done.
  • Phase 1–2: skipped.

Stealth config that works

None needed. Plain fetch with a generic User-Agent.

await fetch("https://huggingface.co/api/models?...", {
  headers: { "User-Agent": "Mozilla/5.0 torch-scraper" },
});

Read the full file on GitHub · 142 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 142 lines · 0 tokens per session scan A 9f790732e877

Subscribe to this mod's changes

huggingface is a skill published in the GitHub repository AgentComputerAI/torch (5 stars, last pushed 4mo ago), licensed MIT. It adds 105 tokens to every session and 1,613 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a…

shanraisshan/claude-code-best-practice · 108 tokens

tiny-web-crawler

Crawl from one or more starting web pages, fetch readable content, search within pages, follow relevant links, and stop when the requested information is found or a bounded limit is reached.

leon-ai/leon · 42 tokens

tutti-workspace-app-factory

Create, convert, or repair one Tutti workspace app as either a self-contained publishable package under package/ or a Chrome-style local debug app under .tutti/dev-app/. Use for mention://workspace-app-factory/create handoffs, mention://workspace-app-factory handoffs, standalone app generation, adapting existing…

tutti-os/tutti · 138 tokens

computer-use

Read and drive native desktop applications through the accessibility layer — list on-screen apps, snapshot one window as a numbered element tree, then click / type / set a value / scroll / drag / run a named action, by element index or by screen coordinates. Use for work in a desktop app rather than a web page. Full…

kirodotdev/KiroCrew · 105 tokens

tutti-record-agent-session-replay

From a Tutti checkout, run, audit, freshly replay, publish, or diagnose Session Replay cassettes that are driven by case-repository scenario scripts (CDP), not by interactive UI recording. Use for real-Provider capture while a scenario.mjs executes, cassette transport or semantic-state mismatches, fresh replay…

tutti-os/tutti · 127 tokens

feature-demo-recording

Record a demo video of a web feature from a real browser. Two modes -- a NARRATED film where measured voiceover drives the timeline (designed slides, subtitles, punch-in camera, rendered from an HTML timeline), and a SILENT evidence clip for a PR or a QA pass. Use when the user asks to record a video, demo, or screen…

kirodotdev/KiroCrew · 90 tokens