---
title: "Preview Dataset From Hub"
method: POST
path: "/felix/datasets/preview-from-hub"
tags: ["felix", "datasets"]
---

# Preview Dataset From Hub

`POST /felix/datasets/preview-from-hub`

Preview a dataset from HuggingFace Hub without saving it.

Fetches the dataset and returns a preview (first 50 rows, schema, metadata)
for user review before confirming the import.

Requires a HuggingFace API token with read access.

## Request body

- HuggingFacePullRequest — Request to pull dataset from HuggingFace Hub.
  - `repo_id` string, required — HuggingFace repo ID to pull from
  - `revision` string, nullable — Specific revision/branch to pull
  - `name` string, nullable — Name for the local dataset (defaults to repo name)
  - `hf_token` string, required — HuggingFace API token
  - `session_id` string, nullable — Session ID for SSE log streaming
  - `column_mapping` object, nullable — Column mapping from source to standard names
  - `dataset_type` string, nullable — Dataset type (ner, classification, custom)

## Response `200`

Successful Response

- HuggingFacePullPreviewResponse — Response containing preview data from a HuggingFace dataset pull (without saving).
  - `preview_rows` object[], required — Sample rows from the dataset (first 50 rows)
  - `total_rows` integer, required — Total number of rows in the dataset
  - `columns` string[], required — List of column names
  - `dataset_type` string, required — Inferred dataset type (classification, ner, custom)
  - `schema_` object, nullable — Inferred schema mapping column names to data types
  - `metadata` object, nullable — Dataset metadata from HuggingFace

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pioneer/apis/brain-api.md) · [All operations](https://skmtc.net/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pioneer/brain-api/revisions/b92f75fd3b61/schema)
