{
  "openapi": "3.0.1",
  "info": {
    "title": "npm and PyPI Package Scraper: Downloads, Versions, Licenses",
    "description": "Scrape npm and PyPI packages by name or keyword: latest version, description, license, maintainers, repository, homepage, keywords, dependency counts, release dates, release count, weekly and monthly downloads. Official public APIs, no login.",
    "version": "1.0",
    "x-build-id": "a4kso8xZMxo6WLk9n"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhtech~npm-pypi-package-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhtech-npm-pypi-package-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/zhtech~npm-pypi-package-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zhtech-npm-pypi-package-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/zhtech~npm-pypi-package-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zhtech-npm-pypi-package-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": {
          "packages": {
            "title": "Package names",
            "type": "array",
            "description": "One package per line. Use npm:name or pypi:name to pick the registry (npm:express, npm:@types/node, pypi:requests), or paste a link (https://www.npmjs.com/package/express, https://pypi.org/project/requests/). A plain name is looked up in the registries selected under Ecosystem; with both, a row is saved for each registry where it exists. Versions and extras are ignored (express@4, requests==2.31). Leave it empty to only use search keywords. An empty input runs the example list.",
            "items": {
              "type": "string"
            }
          },
          "ecosystem": {
            "title": "Ecosystem",
            "enum": [
              "both",
              "npm",
              "pypi"
            ],
            "type": "string",
            "description": "Which registries to use for plain names and for search keywords. Names with an npm: or pypi: prefix or a link always go to their own registry (if that registry is selected here).",
            "default": "both"
          },
          "searchKeywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Find packages instead of naming them. npm: the official registry search, ranked by relevance, with npm search qualifiers such as keywords:scraper, author:sindresorhus, maintainer:fb55, scope:types or not:deprecated. PyPI: pypi.org has no search that its robots.txt allows, so the actor uses the pypistats.org name search, which returns up to 20 packages whose name starts with your keyword (web-scraper, fastapi).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxSearchResults": {
            "title": "Max packages per keyword",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Per keyword and registry, best matches first. npm allows up to 5000; the PyPI name search returns at most 20.",
            "default": 10
          },
          "includeDownloads": {
            "title": "Include download counts",
            "type": "boolean",
            "description": "Weekly and monthly downloads (npm: api.npmjs.org, up to 128 packages per request; PyPI: pypistats.org, mirrors excluded, plus the last day). Search results from npm already include them.",
            "default": true
          },
          "minWeeklyDownloads": {
            "title": "Minimum weekly downloads",
            "minimum": 0,
            "type": "integer",
            "description": "Skip packages with fewer weekly downloads. Skipped packages are not saved and not charged. 0 keeps everything.",
            "default": 0
          },
          "releaseHistoryLimit": {
            "title": "Versions in release history",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Newest versions listed in releaseHistory with their dates and a pre-release flag. 0 leaves the list out. PyPI release feeds hold the last 40 releases.",
            "default": 10
          },
          "includeDependencyList": {
            "title": "Include dependency list (npm)",
            "type": "boolean",
            "description": "Adds the runtime and peer dependencies of the latest npm version with their version ranges. Counts are always included.",
            "default": false
          },
          "includeMaintainerEmails": {
            "title": "Include maintainer emails (npm)",
            "type": "boolean",
            "description": "Adds authorEmail and maintainerEmails where the npm registry publicly lists them. Off by default. If you turn it on, you are responsible for following privacy and anti spam laws (GDPR, CAN-SPAM and others). PyPI emails are never collected: PyPI's terms forbid using its data to sell users' personal information.",
            "default": false
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the run after this many saved packages. 0 means no limit. Your maximum cost per run (set in the run options) is respected as well.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: these are public APIs and the actor uses them slowly. Leave it off unless you see BLOCKED or RATE_LIMITED errors. Datacenter proxy is enough; residential is replaced with datacenter automatically.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}