{
  "openapi": "3.0.1",
  "info": {
    "title": "Hugging Face Scraper",
    "description": "Extract AI models, datasets, spaces, and papers from Hugging Face Hub. Filter by task, library, author, or language. Sort by downloads, likes, or trending. No API key needed.",
    "version": "0.1",
    "x-build-id": "LIcyX0Y35y38Dt3qN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~huggingface-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-huggingface-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/automation-lab~huggingface-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-huggingface-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/automation-lab~huggingface-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-huggingface-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",
        "properties": {
          "resourceType": {
            "title": "🗂️ Resource type",
            "enum": [
              "models",
              "datasets",
              "spaces",
              "papers"
            ],
            "type": "string",
            "description": "Choose what to scrape: AI models, datasets, spaces (apps/demos), or research papers.",
            "default": "models"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Search keyword to filter results (e.g. \"llama\", \"stable diffusion\", \"bert\"). Leave empty to browse all items."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of items to extract. Set 0 for unlimited (use with caution — HF has millions of models).",
            "default": 100
          },
          "trendingMode": {
            "title": "🔥 Trending models mode",
            "type": "boolean",
            "description": "When enabled, overrides Resource type to Models and Sort by to Trending. Quickly get the hottest models gaining momentum right now.",
            "default": false
          },
          "comparisonMode": {
            "title": "📊 Comparison mode (models only)",
            "type": "boolean",
            "description": "When enabled, saves a structured comparison table to the Key-Value Store under key MODEL_COMPARISON. Each row includes rank, license, downloads, likes, framework, and README excerpt — ideal for diffing models side by side.",
            "default": false
          },
          "includeReadmeExcerpt": {
            "title": "📄 Include README excerpt (models only)",
            "type": "boolean",
            "description": "When enabled, fetches the first 500 characters of each model's README card. Adds one API request per model — use with small maxItems (≤20) to avoid slow runs.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "downloads",
              "likes",
              "trendingScore",
              "createdAt",
              "lastModified"
            ],
            "type": "string",
            "description": "Sort results by downloads, likes, trending score, or creation date. \"Trending\" reflects recent momentum. Ignored when Trending mode is enabled.",
            "default": "downloads"
          },
          "pipelineTag": {
            "title": "Task / pipeline tag",
            "enum": [
              "",
              "text-generation",
              "text-classification",
              "token-classification",
              "question-answering",
              "summarization",
              "translation",
              "fill-mask",
              "text2text-generation",
              "image-classification",
              "image-segmentation",
              "object-detection",
              "image-to-text",
              "text-to-image",
              "text-to-video",
              "automatic-speech-recognition",
              "audio-classification",
              "text-to-speech",
              "sentence-similarity",
              "feature-extraction",
              "zero-shot-classification",
              "zero-shot-image-classification",
              "visual-question-answering",
              "document-question-answering",
              "depth-estimation",
              "video-classification",
              "reinforcement-learning",
              "tabular-classification",
              "tabular-regression",
              "time-series-forecasting"
            ],
            "type": "string",
            "description": "Filter models/datasets by ML task type. Leave empty for all tasks."
          },
          "library": {
            "title": "Library / framework",
            "enum": [
              "",
              "transformers",
              "diffusers",
              "sentence-transformers",
              "timm",
              "peft",
              "llama-cpp",
              "pytorch",
              "tensorflow",
              "jax",
              "keras",
              "onnx",
              "safetensors",
              "mlx",
              "fastai",
              "flair",
              "spacy",
              "openai-whisper",
              "stable-baselines3"
            ],
            "type": "string",
            "description": "Filter models by ML framework. Leave empty for all frameworks. Models only."
          },
          "license": {
            "title": "License",
            "enum": [
              "",
              "mit",
              "apache-2.0",
              "openrail",
              "openrail++",
              "llama3",
              "llama3.1",
              "llama3.2",
              "llama3.3",
              "gemma",
              "gpl-3.0",
              "lgpl-3.0",
              "bsd-3-clause",
              "bsd-2-clause",
              "cc-by-4.0",
              "cc-by-sa-4.0",
              "cc-by-nc-4.0",
              "cc-by-nc-sa-4.0",
              "cc0-1.0",
              "wtfpl",
              "other",
              "unlicense"
            ],
            "type": "string",
            "description": "Filter models by license type. Useful for finding commercially usable open-source models. Leave empty for all licenses. Models only."
          },
          "author": {
            "title": "Author / organization",
            "type": "string",
            "description": "Filter by author username or organization name. Examples: meta-llama, google, microsoft, mistralai, stabilityai."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Filter models/datasets by language code. Examples: en, fr, zh, de, es, ja, ar."
          },
          "batchSize": {
            "title": "Batch size (items per request)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of items fetched per API request. Maximum 100. Reduce to 25-50 if you hit rate limits.",
            "default": 100
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of retry attempts for failed HTTP requests.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}