{
  "openapi": "3.0.1",
  "info": {
    "title": "Package Registry Stats: npm, PyPI, Maven, Cargo, Go",
    "description": "Is this open-source package maintained, popular and safe? Downloads, dependents, latest release, licence, GitHub stars and security advisories for npm, PyPI, Maven, Cargo, NuGet, Go and more. Daily new-release feed with delta mode.",
    "version": "1.0",
    "x-build-id": "edvReE5FOqlncOqM1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datacrate~package-registry-stats/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datacrate-package-registry-stats",
        "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/datacrate~package-registry-stats/runs": {
      "post": {
        "operationId": "runs-sync-datacrate-package-registry-stats",
        "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/datacrate~package-registry-stats/run-sync": {
      "post": {
        "operationId": "run-sync-datacrate-package-registry-stats",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "lookup",
              "recentReleases",
              "top",
              "keyword"
            ],
            "type": "string",
            "description": "lookup = stats for specific packages. recentReleases = packages that published a release in the last N days (a release feed). top = most downloaded / most depended-on packages of a registry. keyword = top packages tagged with a keyword.",
            "default": "lookup"
          },
          "packages": {
            "title": "Packages (lookup mode)",
            "type": "array",
            "description": "One per line as ecosystem:name, e.g. npm:react, npm:@babel/core, pypi:requests, cargo:serde, maven:org.apache.commons:commons-lang3, nuget:Newtonsoft.Json, go:github.com/gin-gonic/gin. Package URLs (pkg:npm/lodash) also work.",
            "default": [
              "npm:react",
              "pypi:requests",
              "cargo:serde",
              "maven:org.apache.commons:commons-lang3",
              "nuget:Newtonsoft.Json",
              "go:github.com/gin-gonic/gin"
            ],
            "items": {
              "type": "string"
            }
          },
          "ecosystem": {
            "title": "Registry (recentReleases, top, keyword)",
            "enum": [
              "npm",
              "pypi",
              "cargo",
              "maven",
              "nuget",
              "go",
              "rubygems",
              "packagist",
              "pub",
              "cocoapods"
            ],
            "type": "string",
            "description": "Which package registry to scan.",
            "default": "npm"
          },
          "keyword": {
            "title": "Keyword (keyword mode)",
            "type": "string",
            "description": "Package keyword, e.g. machine-learning, cli, react, authentication."
          },
          "sinceDays": {
            "title": "Released in the last N days (recentReleases)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Only packages whose latest release is newer than this (1 to 365). Use 1 for a daily feed.",
            "default": 1
          },
          "sortBy": {
            "title": "Sort by (top, keyword)",
            "enum": [
              "downloads",
              "dependent_repos_count",
              "dependent_packages_count",
              "stargazers_count",
              "latest_release_published_at",
              "created_at"
            ],
            "type": "string",
            "description": "Ranking field, highest first.",
            "default": "downloads"
          },
          "minDownloads": {
            "title": "Minimum downloads",
            "minimum": 0,
            "type": "integer",
            "description": "Keep packages with at least this many downloads (period shown in the downloadsPeriod column; usually last month).",
            "default": 0
          },
          "minDependentRepos": {
            "title": "Minimum dependent repositories",
            "minimum": 0,
            "type": "integer",
            "description": "Keep packages used by at least this many repositories.",
            "default": 0
          },
          "minStars": {
            "title": "Minimum GitHub stars",
            "minimum": 0,
            "type": "integer",
            "description": "Keep packages whose linked repository has at least this many stars.",
            "default": 0
          },
          "licenses": {
            "title": "Allowed licences",
            "type": "array",
            "description": "Keep only packages with one of these SPDX licences, e.g. MIT, Apache-2.0. Empty = any.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyWithAdvisories": {
            "title": "Only packages with security advisories",
            "type": "boolean",
            "description": "Keep only packages with at least one published advisory.",
            "default": false
          },
          "excludeDeprecated": {
            "title": "Exclude deprecated or archived",
            "type": "boolean",
            "description": "Drop packages marked deprecated/removed or whose repository is archived.",
            "default": false
          },
          "maxItems": {
            "title": "Max packages to return",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound on rows (and on cost).",
            "default": 50
          },
          "onlyNewSinceLastRun": {
            "title": "Delta mode (only new since last run)",
            "type": "boolean",
            "description": "recentReleases, top and keyword modes: skip packages/versions already returned by an earlier run with the same state name. The first run returns everything and sets the baseline.",
            "default": false
          },
          "stateKey": {
            "title": "State name (delta mode)",
            "type": "string",
            "description": "Use different names to keep separate watchlists.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}