Hugging Face Hub API
Pricing
from $0.01 / 1,000 results
Hugging Face Hub API
Access the Hugging Face Hub API to search & discover models, datasets & spaces. Search Models: Find ML models by name, task or library Search Datasets: Discover datasets for training & evaluation Search Spaces: Explore ML applications Get Metadata: Retrieve detailed repo information
Pricing
from $0.01 / 1,000 results
Rating
0.0
(0)
Developer
The Howlers
Maintained by CommunityActor stats
1
Bookmarked
4
Total users
0
Monthly active users
4 days ago
Last modified
Categories
Security
Limited permissionsShare
Hugging Face Hub
Hugging Face Hub API - search models, datasets, spaces, manage collections, and access repository metadata.
BYOK (Bring Your Own Key) -- you provide your own API credentials.
Before You Start
This actor requires your own API credentials to fetch real data.
Where to get your key: Your Hugging Face API token (optional for public data)
Demo Mode is off by default, so runs fetch real data. Set demoMode to true to get free sample data that shows the output format, no key needed.
Quick Start
Test with Demo Mode (free, no API key needed)
{"demoMode": true}
Run with real data
{"demoMode": false,"task": "search_models","apiToken": "YOUR_API_KEY_HERE","sort": "downloads","direction": "desc","limit": 20,"includeCardData": false}
Input Parameters
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
task | string | "search_models" | Yes* | The Hub operation to perform |
apiToken | string | - | Yes* | Your Hugging Face API token (optional for public data) |
query | string | - | No | Search term for models, datasets, or spaces |
repoId | string | - | No | Full repository ID (e.g., meta-llama/Llama-2-7b-hf) |
filter | string | - | No | Filter by task, library, or other criteria |
taskType | string | - | No | Filter by ML task type |
library | string | - | No | Filter by framework/library |
sort | string | "downloads" | No | Sort results by |
direction | string | "desc" | No | Sort direction |
limit | integer | 20 | No | Maximum number of results to return |
includeCardData | boolean | false | No | Include model/dataset card metadata |
webhookUrl | string | - | No | URL to receive results via webhook |
demoMode | boolean | false | No | Run with sample data (no API calls) |
*Required when Demo Mode is off.
Pricing
This actor uses pay-per-event billing:
| Event | When it is charged | Price |
|---|---|---|
| Actor start | Once when the run starts, one event per GB of memory (minimum one). At the default 4 GB of memory a run starts at $0.40 | $0.10 per GB |
| Search Models | Search for ML models by name, task, or library | $0.01 |
| Get Model Details | Retrieve detailed model repository information | $0.01 |
| Search Datasets | Search for datasets by query or ML task | $0.01 |
| Get Dataset Details | Retrieve detailed dataset repository information | $0.01 |
| Search Spaces | Search for Hugging Face Spaces (ML demos) | $0.01 |
| Get Space Details | Retrieve detailed Space information and runtime status | $0.01 |
| List Model Files | List all files in a model repository | $0.01 |
| Get Model Card | Retrieve the model card (README) content and metadata | $0.01 |
| Trending Models | Get currently trending models on Hugging Face Hub | $0.01 |
| Trending Datasets | Get currently trending datasets on Hugging Face Hub | $0.01 |
| Result | Each item written to the default dataset | $0.00001 |
Demo mode is free -- no charges for sample data.
Troubleshooting
"API key is required"
You have Demo Mode turned off but didn't provide an API key. Either:
- Turn Demo Mode on to test with sample data
- Add your API key in the input
"API error 403" or "Unauthorized"
Your API key is invalid, expired, or doesn't have access to this specific API endpoint. Double-check your key and account permissions.
"API error 429" or "Rate limit"
Too many requests. Wait a minute and try again, or reduce the number of items per run.
No results or empty dataset
Check the run log for error messages. Common causes:
- Invalid input format (check the examples above)
- API key without proper permissions
- The target data doesn't exist or is too small to track
How do I test without an API key?
Enable Demo Mode in the input. This returns realistic sample data so you can verify the output format works for your workflow.
Built by John Rippy | Actor Arsenal