{
  "openapi": "3.0.1",
  "info": {
    "title": "Hugging Face Scraper — Models, Datasets & Spaces",
    "description": "Scrape the Hugging Face Hub from any URL or text query, with automatic detection of models, datasets, spaces, papers, users, orgs and collections. Returns deep model cards, lineage, evaluation results and dataset configs.",
    "version": "1.2",
    "x-build-id": "dekXHYB8ye7HD58dI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~huggingface-all-in-one-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-huggingface-all-in-one-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/khadinakbar~huggingface-all-in-one-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-huggingface-all-in-one-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/khadinakbar~huggingface-all-in-one-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-huggingface-all-in-one-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "targets"
        ],
        "properties": {
          "targets": {
            "title": "Hugging Face URLs or text queries",
            "type": "array",
            "description": "List of Hugging Face URLs OR plain-text search queries. Each item is auto-detected: model URL (https://huggingface.co/meta-llama/Llama-3.1-8B), dataset URL (/datasets/squad), space URL (/spaces/HuggingFaceM4/idefics_playground), paper URL (/papers/2310.06825), user URL (/karpathy), org URL (/meta-llama), collection URL (/collections/...), or a free-text query like 'qwen 3 instruct'. NOT for inference API calls — use the hugging-face-image-ai or hugging-face-audio-ai actors for that.",
            "items": {
              "type": "string"
            }
          },
          "entityType": {
            "title": "Entity type for text queries",
            "enum": [
              "models",
              "datasets",
              "spaces",
              "papers",
              "all"
            ],
            "type": "string",
            "description": "When a target is a text query (not a URL), search this entity type on Hugging Face. Ignored when the target is a URL — type is auto-detected from the path. Defaults to 'models'. Use 'all' to search models, datasets, and spaces and return the union.",
            "default": "models"
          },
          "resultsPerTarget": {
            "title": "Max results per target",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on records returned per target. For a single URL (model/dataset/space/paper) you get 1 deep record. For a search query, user, org, or collection target, this caps how many entity records are returned. Defaults to 50. Maximum 500 per target to keep runs predictable.",
            "default": 50
          },
          "sortBy": {
            "title": "Sort search results",
            "enum": [
              "downloads",
              "likes",
              "modified",
              "trending"
            ],
            "type": "string",
            "description": "Sort key for search-query targets and user/org/collection portfolio listings. 'downloads' returns most-downloaded first (best for popularity), 'likes' returns community-favored first, 'modified' returns recently updated first, 'trending' surfaces what is hot right now. Has no effect on single-URL targets.",
            "default": "downloads"
          },
          "filterTask": {
            "title": "Filter by task / pipeline tag",
            "type": "string",
            "description": "Filter search-query model targets by pipeline_tag (Hugging Face task taxonomy). Examples: 'text-generation', 'image-classification', 'automatic-speech-recognition'. Leave empty for no filter. Ignored for dataset, space, paper, user, org, and URL targets."
          },
          "filterLibrary": {
            "title": "Filter by library",
            "type": "string",
            "description": "Filter search-query model targets by library_name. Examples: 'transformers', 'diffusers', 'gguf', 'safetensors'. Leave empty for no filter. Ignored for dataset, space, paper, user, org, and URL targets."
          },
          "filterLanguage": {
            "title": "Filter by language",
            "type": "string",
            "description": "Filter search-query model and dataset targets by language code. Use ISO 639-1 like 'en', 'es', 'zh', 'multilingual'. Leave empty for no filter. Ignored for space, paper, user, org, and URL targets."
          },
          "includeReadme": {
            "title": "Include full README text",
            "type": "boolean",
            "description": "When true, fetches the full Markdown README for each model/dataset/space (one extra HTTP request per record). When false, returns only API metadata. Defaults to true for URL targets, false for bulk searches to keep token cost down.",
            "default": true
          },
          "responseFormat": {
            "title": "Response shape for AI agents",
            "enum": [
              "concise",
              "detailed"
            ],
            "type": "string",
            "description": "Controls dataset item richness. 'concise' returns a token-efficient subset (id, downloads, likes, task, lastModified — best for AI agents and ≤200 tokens/item). 'detailed' returns every parsed field including tags, siblings, eval results, full README. Defaults to 'detailed'.",
            "default": "detailed"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings. Datacenter is fine — Hugging Face API has no anti-bot. Residential is overkill. Defaults to Apify datacenter pool.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}