# Hugging Face collections API

Get Hugging Face Collections data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, q, and retrieve structured data including collection display title, description, owner, last updated, and id to discover curated model stacks, track organization showcases, and feed downstream detail lookups.

Documentation: https://openany.si/hugging-face/hugging-face-collections-api/61f18da2-c8b4-42ad-8789-905cf37051a8/
API ID: 61f18da2-c8b4-42ad-8789-905cf37051a8
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/huggingface/v1/collections
Page update time: 2026-12-03T02:43:38.133Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:43:36.519Z. This is not a price-change timestamp.
```json
{
  "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": []
  }
}
```

## Usage and limits
## Hugging Face Collections API

Query public Hugging Face collections with optional q, owner, item (comma-separated resource IDs such as models/meta-llama/Llama-3.1-8B-Instruct), sort (trending, upvotes or modified), limit (default 20, max 100) and cursor parameters. Each collection includes owner details, upvote counts, timestamps and nested items\[\].

## What You Can Build

- **Discover curated model stacks**: Find community-maintained collections containing a flagship model or dataset using the item filter.
- **Track organization showcases**: Filter by owner to pull official release bundles published by AI labs on Hugging Face Hub.
- **Feed downstream detail lookups**: Read items\[\].items\[\].id and type to chain into Model Details, Dataset Details, Space or Paper APIs.

## Returned Data

| Field | Meaning |
| --- | --- |
| `items[].slug` | Unique collection slug on Hugging Face Hub |
| `items[].title` | Collection display title |
| `items[].description` | Short summary written by the collection owner |
| `items[].owner` | Username or organization owning the collection |
| `items[].owner_type` | Owner account type such as user or org |
| `items[].upvotes` | Community upvote count for the collection |
| `items[].last_updated` | Timestamp of the most recent collection update |
| `items[].items[].id` | Identifier of each linked model, dataset, Space or paper |
| `items[].items[].type` | Resource type of the linked collection item |
| `next_cursor` | Opaque cursor for the next page, or null on the last page |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Hugging Face collections API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "q": {
          "type": "string",
          "description": "Words in the collection title."
        },
        "owner": {
          "type": "string",
          "description": "Only collections of this user or organization."
        },
        "item": {
          "type": "string",
          "description": "Collections containing an item, e.g. `models/meta-llama/Llama-3.1-8B-Instruct` (comma-separated for several)."
        },
        "sort": {
          "type": "string",
          "description": "`trending` (default), `upvotes` or `modified`.",
          "enum": [
            "trending",
            "upvotes",
            "modified"
          ]
        },
        "limit": {
          "type": "integer",
          "description": "Results per page (default 20, max 100)."
        },
        "cursor": {
          "type": "string",
          "description": "`next_cursor` from the previous page; null on the last page."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON exports are not exposed.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "Native CSV/NDJSON record selector; it has no effect on this JSON-only product."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "cached": {
      "type": "boolean"
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "items": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "description": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "gating": {
                "type": "boolean"
              },
              "items": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "downloads": {
                          "type": "integer"
                        },
                        "id": {
                          "type": "string"
                        },
                        "likes": {
                          "type": "integer"
                        },
                        "note": {
                          "anyOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "position": {
                          "type": "integer"
                        },
                        "title": {
                          "type": "null"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              },
              "last_updated": {
                "type": "string"
              },
              "owner": {
                "type": "string"
              },
              "owner_type": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "theme": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "upvotes": {
                "type": "integer"
              },
              "url": {
                "type": "string"
              }
            }
          },
          {
            "type": "string"
          }
        ]
      }
    },
    "next_cursor": {
      "type": "string"
    },
    "query": {
      "type": "string"
    },
    "sort": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/huggingface/v1/collections?output=json&q=llama' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "cached": false,
  "count": 20,
  "credits_used": 1,
  "items": [
    {
      "description": "This collection hosts the transformers and original repos of the Meta Llama 3 and Llama Guard 2 releases",
      "gating": true,
      "items": [
        {
          "downloads": 132549,
          "id": "meta-llama/Meta-Llama-3-8B",
          "likes": 6780,
          "note": null,
          "position": 0,
          "title": null,
          "type": "model"
        },
        {
          "downloads": 319018,
          "id": "meta-llama/Meta-Llama-3-8B-Instruct",
          "likes": 5708,
          "note": "8B models\n",
          "position": 1,
          "title": null,
          "type": "model"
        },
        "… 2 more"
      ],
      "last_updated": "2024-12-06T16:49:01.623Z",
      "owner": "meta-llama",
      "owner_type": "org",
      "slug": "meta-llama/meta-llama-3-66214712577ca38149ebb2b6",
      "theme": "orange",
      "title": "Meta Llama 3",
      "upvotes": 1023,
      "url": "https://huggingface.co/collections/meta-llama/meta-llama-3-66214712577ca38149ebb2b6"
    },
    {
      "description": null,
      "gating": true,
      "items": [
        {
          "downloads": 534018,
          "id": "meta-llama/Llama-3.1-8B",
          "likes": 2751,
          "note": null,
          "position": 0,
          "title": null,
          "type": "model"
        },
        {
          "downloads": 27522,
          "id": "meta-llama/Llama-3.1-70B",
          "likes": 449,
          "note": null,
          "position": 1,
          "title": null,
          "type": "model"
        },
        "… 2 more"
      ],
      "last_updated": "2024-12-13T09:25:04.176Z",
      "owner": "meta-llama",
      "owner_type": "org",
      "slug": "meta-llama/metas-llama-31-models-and-evals-675bfd70e574a62dd0e40565",
      "theme": "orange",
      "title": "Meta's Llama 3.1 models & evals",
      "upvotes": 640,
      "url": "https://huggingface.co/collections/meta-llama/metas-llama-31-models-and-evals-675bfd70e574a62dd0e40565"
    },
    "… 18 more"
  ],
  "next_cursor": "NmFlMjZlY2M0MWYxYjllMWUyMmJkMmEwLTA=",
  "query": "llama",
  "sort": "trending"
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### How do I find collections that include a specific model or dataset?
Pass the Hub item path in item, such as models/meta-llama/Llama-3.1-8B-Instruct; multiple items can be comma-separated.

### What sort orders are supported for collections?
sort accepts trending (default), upvotes or modified.

### How does cursor pagination work on this endpoint?
Pass the returned next_cursor into the cursor parameter on the next request until next_cursor is null.

### How many collections can I request per page?
limit defaults to 20 and accepts up to 100 collections per page.

### Does a collection response include private repositories?
No. The endpoint returns publicly visible Hub collections and their published item references.

### How do caching and response trimming options work?
Output is JSON only. Pass fresh=1 to bypass the 24-hour cache, raw=0 to omit bulky raw blocks, or fields to select specific keys.

## Available implementations
- apish: https://openany.si/hugging-face/hugging-face-collections-api/61f18da2-c8b4-42ad-8789-905cf37051a8/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
