# Hugging Face repository discussions and pull requests API

Get Hugging Face Repo Discussions & PRs data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as id, output, and retrieve structured data including repository identifier, total matching threads reported, status, and is pull request to track community pull requests, and search community threads by keyword.

Documentation: https://openany.si/hugging-face/hugging-face-repository-discussions-and-pull-requests-api/25d4098d-1aef-4325-82b5-04f3ea5ac8dd/
API ID: 25d4098d-1aef-4325-82b5-04f3ea5ac8dd
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/huggingface/v1/model/discussions
Page update time: 2026-12-03T02:43:38.257Z
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:37.413Z. 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 Repo Discussions & PRs API

Pass required id (owner/name or huggingface.co link) with optional type (default model), kind (discussions, pull requests or all), status (default all), sort (default recently-created), author, q (title match) and page (default 1). Returned items\[\] include thread number, title, status, is\_pull\_request flag, author metadata and comment counts.

## What You Can Build

- **Monitor open issues and bug reports**: Filter discussions by status and sort order to spot licensing questions, broken weights or tokenizer bugs.
- **Track community pull requests**: Use kind and is\_pull\_request to surface safetensors conversions, ONNX exports or card fixes.
- **Search Community threads by keyword**: Pass q or author to locate specific maintainer announcements or user reports without scraping HTML.

## Returned Data

| Field | Meaning |
| --- | --- |
| `id` | Repository identifier (owner/name) |
| `type` | Repository type: model, dataset or space |
| `total` | Total matching threads reported |
| `items[].num` | Community thread or pull request number |
| `items[].title` | Thread or pull request title |
| `items[].status` | Thread status such as open, closed or merged |
| `items[].is_pull_request` | Boolean flag distinguishing pull requests from discussions |
| `items[].comments` | Number of comments posted on the thread |
| `items[].author.name` | Username of the thread opener |
| `next_page` | Next page number, or null on the last page |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Hugging Face repository discussions and pull requests 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": {
        "id": {
          "type": "string",
          "description": "Repo id (owner/name) or huggingface.co link."
        },
        "type": {
          "type": "string",
          "description": "Repo type (default model; taken from a pasted link).",
          "enum": [
            "model",
            "dataset",
            "space"
          ]
        },
        "kind": {
          "type": "string",
          "description": "Discussions, pull requests or both (default all).",
          "enum": [
            "all",
            "discussion",
            "pull_request"
          ]
        },
        "status": {
          "type": "string",
          "description": "Status filter (default all).",
          "enum": [
            "all",
            "open",
            "closed"
          ]
        },
        "sort": {
          "type": "string",
          "description": "Sort order (default recently-created).",
          "enum": [
            "recently-created",
            "trending",
            "reactions"
          ]
        },
        "author": {
          "type": "string",
          "description": "Only threads opened by this user."
        },
        "q": {
          "type": "string",
          "description": "Only threads whose title matches this text."
        },
        "page": {
          "type": "integer",
          "description": "Page number (default 1)."
        },
        "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."
        }
      },
      "required": [
        "id"
      ]
    },
    "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"
    },
    "id": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "author": {
                "type": "object",
                "properties": {
                  "avatar": {
                    "type": "string"
                  },
                  "fullname": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "pro": {
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              },
              "comments": {
                "type": "integer"
              },
              "created_at": {
                "type": "string"
              },
              "is_pull_request": {
                "type": "boolean"
              },
              "num": {
                "type": "integer"
              },
              "pinned": {
                "type": "boolean"
              },
              "reactions": {
                "type": "integer"
              },
              "status": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "top_reactions": {
                "type": "array",
                "items": {}
              },
              "url": {
                "type": "string"
              }
            }
          },
          {
            "type": "string"
          }
        ]
      }
    },
    "kind": {
      "type": "string"
    },
    "next_page": {
      "type": "integer"
    },
    "page": {
      "type": "integer"
    },
    "sort": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "total": {
      "type": "integer"
    },
    "type": {
      "type": "string"
    },
    "url": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Official documentation response · Supplier-tr
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/huggingface/v1/model/discussions?id=openai-community%2Fgpt2&output=json' \
  -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": 50,
  "credits_used": 1,
  "id": "openai-community/gpt2",
  "items": [
    {
      "author": {
        "avatar": "https://huggingface.co/avatars/2c5da123c7caa132e6e2a298ae18a671.svg",
        "fullname": "attacker34234",
        "name": "victim3432",
        "pro": false,
        "type": "user",
        "url": "https://huggingface.co/victim3432"
      },
      "comments": 1,
      "created_at": "2026-11-04T00:58:59.000Z",
      "is_pull_request": true,
      "num": 202,
      "pinned": false,
      "reactions": 0,
      "status": "closed",
      "title": "pr7448",
      "top_reactions": [],
      "url": "https://huggingface.co/openai-community/gpt2/discussions/202"
    },
    {
      "author": {
        "avatar": "https://huggingface.co/avatars/d47558c152546cbbcdef1db0447ab7f0.svg",
        "fullname": "negm",
        "name": "Yousef9828",
        "pro": false,
        "type": "user",
        "url": "https://huggingface.co/Yousef9828"
      },
      "comments": 1,
      "created_at": "2026-10-19T12:48:35.000Z",
      "is_pull_request": false,
      "num": 201,
      "pinned": false,
      "reactions": 0,
      "status": "closed",
      "title": "Test discussion",
      "top_reactions": [],
      "url": "https://huggingface.co/openai-community/gpt2/discussions/201"
    },
    "… 48 more"
  ],
  "kind": "all",
  "next_page": 2,
  "page": 1,
  "sort": "recently-created",
  "status": "all",
  "total": 186,
  "type": "model",
  "url": "https://huggingface.co/openai-community/gpt2/discussions"
}
```

## 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
### Can I list discussions for datasets and Spaces as well as models?
Yes. Pass type=dataset or type=space, or supply the full huggingface.co URL in id so the type is inferred automatically.

### How do I separate pull requests from regular discussions?
Filter with the kind parameter, and check items[].is_pull_request on each returned thread.

### Can I filter by thread status, author or title keywords?
Yes. Use status, author and q (title text match) individually or together.

### How are threads sorted and paginated?
sort defaults to recently-created and pagination uses page (default 1) with next_page until null.

### Does this endpoint return the full body of every comment in a thread?
No. It returns thread-level summaries including title, status, author, comment count, reactions and URL.

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

## Available implementations
- apish: https://openany.si/hugging-face/hugging-face-repository-discussions-and-pull-requests-api/25d4098d-1aef-4325-82b5-04f3ea5ac8dd/

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