{
  "openapi": "3.0.1",
  "info": {
    "title": "Hugging Face Scraper — Trending Models, Datasets & Spaces",
    "description": "Scrape trending, most downloaded, most liked and newest Hugging Face models, datasets and Spaces: downloads, likes, trending score, task, library, license, model size, Space runtime and model cards. Monitor new releases and likes/downloads growth.",
    "version": "1.0",
    "x-build-id": "woscj67cXXdaSVBlY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mersetti~huggingface-hub-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mersetti-huggingface-hub-trends",
        "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/mersetti~huggingface-hub-trends/runs": {
      "post": {
        "operationId": "runs-sync-mersetti-huggingface-hub-trends",
        "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/mersetti~huggingface-hub-trends/run-sync": {
      "post": {
        "operationId": "run-sync-mersetti-huggingface-hub-trends",
        "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": {
          "resourceTypes": {
            "title": "Resource types",
            "type": "array",
            "description": "What to scrape from the Hugging Face Hub: \"models\", \"datasets\" and/or \"spaces\". Each type is listed separately and gets its own maxItems.",
            "default": [
              "models"
            ],
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "trendingScore",
              "downloads",
              "likes",
              "lastModified",
              "createdAt"
            ],
            "type": "string",
            "description": "Order of the list (always descending). \"trendingScore\" = what is trending on huggingface.co right now. Spaces have no downloads, so \"downloads\" sorts Spaces by likes.",
            "default": "trendingScore"
          },
          "maxItems": {
            "title": "Max items per resource type",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of models, datasets and Spaces (each) to output after filtering.",
            "default": 50
          },
          "search": {
            "title": "Search",
            "type": "string",
            "description": "Keyword matched against repo names, e.g. \"llama\", \"whisper\", \"flux\". Empty = no keyword filter."
          },
          "authors": {
            "title": "Authors / organizations",
            "type": "array",
            "description": "Only repos owned by these users or organizations, e.g. \"google\", \"meta-llama\", \"Qwen\". Several authors are queried separately and merged.",
            "items": {
              "type": "string"
            }
          },
          "pipelineTags": {
            "title": "Tasks (pipeline tags)",
            "type": "array",
            "description": "Only models with these tasks, e.g. \"text-generation\", \"text-to-image\", \"automatic-speech-recognition\". For datasets this filters by task category. Ignored for Spaces.",
            "items": {
              "type": "string"
            }
          },
          "libraries": {
            "title": "Libraries",
            "type": "array",
            "description": "Only models tagged with these libraries, e.g. \"transformers\", \"diffusers\", \"gguf\", \"mlx\", \"sentence-transformers\". Models only.",
            "items": {
              "type": "string"
            }
          },
          "minDownloads": {
            "title": "Min downloads (last 30 days)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip models and datasets with fewer downloads in the last 30 days. 0 = no minimum. Ignored for Spaces.",
            "default": 0
          },
          "minLikes": {
            "title": "Min likes",
            "minimum": 0,
            "type": "integer",
            "description": "Skip repos with fewer likes. 0 = no minimum.",
            "default": 0
          },
          "createdWithinDays": {
            "title": "Created within last N days",
            "minimum": 0,
            "type": "integer",
            "description": "Only repos created in the last N days (e.g. 7 for new trending releases). 0 = any age. Tip: combine with sort \"createdAt\" or \"trendingScore\".",
            "default": 0
          },
          "itemIds": {
            "title": "Specific repos (optional)",
            "type": "array",
            "description": "Scrape these exact repos instead of (or in addition to) lists. Use ids or URLs: \"meta-llama/Llama-3.1-8B-Instruct\" (model), \"datasets/openai/gsm8k\", \"spaces/enzostvs/deepsite\" or https://huggingface.co/... links. List filters do not apply to them.",
            "items": {
              "type": "string"
            }
          },
          "includeCard": {
            "title": "Include model / dataset card (README)",
            "type": "boolean",
            "description": "Adds the README text (model card, dataset card or Space README) without its YAML header, as Markdown in the \"card\" field. One extra request per item. Gated repos return cardError \"gated or private\".",
            "default": false
          },
          "cardMaxChars": {
            "title": "Max card length (characters)",
            "minimum": 500,
            "maximum": 500000,
            "type": "integer",
            "description": "Longer cards are cut to this length (cardTruncated = true).",
            "default": 20000
          },
          "monitorMode": {
            "title": "Monitor mode",
            "enum": [
              "off",
              "new",
              "growth",
              "newAndGrowth"
            ],
            "type": "string",
            "description": "\"off\": output every matching item. \"new\": only items not seen in previous runs (e.g. newly trending models). \"growth\": only items whose likes or downloads grew since the previous run. \"newAndGrowth\": both. Schedule the Actor (e.g. daily) to get a change feed; you pay only for output items.",
            "default": "off"
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name of the saved state. Use different IDs for different watchlists.",
            "default": "default"
          },
          "baselineOnFirstRun": {
            "title": "Silent first run",
            "type": "boolean",
            "description": "The first time a list (resource type + filters) is monitored, only save its items (no output, no cost), so later runs report real changes.",
            "default": true
          },
          "minLikesGrowth": {
            "title": "Min likes growth",
            "minimum": 0,
            "type": "integer",
            "description": "Growth mode: report an item when its likes grew by at least this many since the previous run. 0 = any growth (likes or downloads).",
            "default": 1
          },
          "minDownloadsGrowth": {
            "title": "Min downloads growth",
            "minimum": 0,
            "type": "integer",
            "description": "Growth mode: also report an item when its downloads grew by at least this many since the previous run (all-time downloads when available). 0 = do not use downloads.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}