API template library

Simulate the Hugging Face Dataset Viewer API

A WireMock simulation of Hugging Face's REST API — covering dataset validity and splits, metadata and sizes, Parquet listings, first rows, row paging, full-text search, filtering, and column statistics.

Vendor
Hugging Face
Functionality
Splits, rows, search, statistics
Spec version
1.0
Endpoints
12
Stubs
54
Protocol
REST
Validation
AI-validated Before publication, an AI agent exercised these endpoints against the real Hugging Face API through WireMock's recording proxy, and the recorded traffic was used to verify each stub's request and response shapes.

Live sandbox · no signup, no API key

Hugging Face Dataset Viewer API

A running WireMock Cloud instance of this template, callable right now from a terminal, a script, or an AI agent.

Base URL
https://ygy7qk.wiremockapi.cloud

GET First rows of a split [listFirstRows] - train

curl -s -X GET 'https://ygy7qk.wiremockapi.cloud/first-rows?dataset=stanfordnlp%2Fimdb&config=plain_text&split=train'

GET First rows of a split [listFirstRows] - test

curl -s -X GET 'https://ygy7qk.wiremockapi.cloud/first-rows?dataset=stanfordnlp%2Fimdb&config=plain_text&split=test'

GET First rows of a split [listFirstRows] - unsupervised

curl -s -X GET 'https://ygy7qk.wiremockapi.cloud/first-rows?dataset=stanfordnlp%2Fimdb&config=plain_text&split=unsupervised'
Method Path Summary
GET /filter Filter rows of a split
GET /first-rows First rows of a split
GET /info Get the metadata of a dataset.
GET /is-valid Check if a dataset is valid
GET /opt-in-out-urls Get the number of opted-in and opted-out image URLs in a dataset.
GET /parquet List of parquet files
GET /presidio-entities Get the number of rows containing Presidio entities in a dataset.
GET /rows A slice of rows of a split
GET /search Full-text search in the text columns of a split
GET /size Get the size of a dataset.
GET /splits List of splits
GET /statistics Descriptive statistics of a split's columns

Unauthenticated WireMock Cloud demo sandbox for Hugging Face — not an official Hugging Face sandbox, and it returns simulated example data only.

What's inside the Dataset Viewer template

The template replays real responses from datasets-server.huggingface.co, recorded for the public stanfordnlp/imdb dataset. Row requests page through real reviews with their true row_idx and the split's real total, 25,000 rows for train. Filtering the test split on "label"=1 starts at row 12,500, because imdb's splits are sorted by label. Code that previews datasets, builds sample pages or checks split sizes gets genuine data to work with.

  • Discovery — is-valid capabilities, splits, dataset info and size, and Parquet file listings
  • Row access — first rows of a split, and offset and length paging with real positions
  • Search and filter — case-insensitive text search and single-condition equality filters with paged results
  • Statistics — per-column statistics for each split, as the viewer computed them
  • PII and opt-out reports — Presidio entity scans and opt-in or opt-out URL counts

Hugging Face Dataset Viewer mock API FAQ

Only stanfordnlp/imdb, in its plain_text config with the train, test and unsupervised splits. Any other dataset answers the real 401 the live service gives for something it can't see, which is also how it treats private and gated datasets.

They run over the 100 recorded rows of each split, so num_rows_total is the number of matches in that pool. Filters support one equality condition; other where expressions match nothing.

Paging keeps working. Rows beyond the recorded 100 repeat those rows in order while row_idx keeps counting, so loops that walk a whole split reach the end in the expected number of pages.

No, as with the live service for public datasets. Don't add a real token to requests against the shared sandbox.

Vendor names identify APIs represented by WireMock template sources. This page does not imply vendor endorsement, certification, partnership, or official integration status.