{
  "openapi": "3.0.1",
  "info": {
    "title": "PyPI Scraper: Package Stats, Downloads & Releases",
    "description": "Scrape PyPI packages by name: version, license, dependencies, repository, day/week/month download counts, full dated release history, and newest-package feeds. Export CSV, Excel, JSON, XML. No login or API key. Example: requests had 163 releases and 1.2B downloads in a month.",
    "version": "0.1",
    "x-build-id": "UKld7hQgietoGRKSI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~pypi-package-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-pypi-package-stats-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/recordsdata~pypi-package-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-pypi-package-stats-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/recordsdata~pypi-package-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-pypi-package-stats-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": {
          "packageNames": {
            "title": "Package names",
            "type": "array",
            "description": "PyPI package names, pypi.org project URLs or requirements.txt lines to scrape for metadata, license, dependencies and download counts (for example requests, numpy, https://pypi.org/project/flask/ or django>=5). Leave empty if you use the top list, a name search or a feed below.",
            "default": [
              "requests",
              "numpy",
              "flask"
            ],
            "items": {
              "type": "string"
            }
          },
          "topN": {
            "title": "Top downloaded packages",
            "minimum": 0,
            "maximum": 15000,
            "type": "integer",
            "description": "Add the N most downloaded PyPI packages of the last 30 days, taken from the community monthly top-15,000 list (refreshed on the 1st of each month). 0 = off. Adds the columns topRank and topDownloads30d. With download stats on, expect about 1 package per second (pypistats.org allows 60 requests per minute); turn download stats off for roughly 3 to 6 packages per second.",
            "default": 0
          },
          "topStartRank": {
            "title": "Top list: first rank",
            "minimum": 1,
            "maximum": 15000,
            "type": "integer",
            "description": "First rank to take from the top list. 1 = the most downloaded package. Use 101 with Top downloaded packages = 100 to get ranks 101 to 200 (handy to split a large pull into several runs).",
            "default": 1
          },
          "searchQueries": {
            "title": "Search package names",
            "type": "array",
            "description": "Texts to look for inside package names, for example scraper or web-scrap. Matching ignores case and treats - _ and . alike (PyPI name rules), so django-rest also finds Django_REST. At least 3 letters or digits per text. Matches are ordered exact name first, then by monthly downloads rank, then by shorter name. The search covers names only (PyPI's own search page is behind a bot challenge and has no public API).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchMaxResultsPerQuery": {
            "title": "Search: max results per text",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many matching packages to take for each search text, best ranked first.",
            "default": 20
          },
          "includeDownloadStats": {
            "title": "Download stats",
            "type": "boolean",
            "description": "Attach last-day / last-week / last-month download counts from pypistats.org to each package. This is the slowest part of a run: pypistats.org allows 60 requests per minute, so about 1 package per second.",
            "default": true
          },
          "includeReleaseHistory": {
            "title": "Release history",
            "type": "boolean",
            "description": "One extra row per released version with date, file count, wheel and source availability, file sizes, Python tags, pre-release flag and yank reason. Each release row is billed like a release record.",
            "default": false
          },
          "includeNewestPackagesFeed": {
            "title": "Newest packages feed",
            "type": "boolean",
            "description": "The latest brand-new packages published on PyPI (RSS, about 40 rows): name, summary, author email, publish time.",
            "default": false
          },
          "includeLatestUpdatesFeed": {
            "title": "Latest updates feed",
            "type": "boolean",
            "description": "The latest version updates across all of PyPI (RSS, about 100 rows): name, new version, summary, author email, publish time.",
            "default": false
          },
          "includeDescription": {
            "title": "Full project description",
            "type": "boolean",
            "description": "Add the long description of the latest release (the README text shown on PyPI, cut at 20,000 characters) as longDescription on package rows. Makes rows much larger.",
            "default": false
          },
          "onlyNewSince": {
            "title": "Only releases since",
            "type": "string",
            "description": "Release monitoring. Keep only packages whose latest release was uploaded at or after this moment, release rows uploaded since then, and feed items published since then. Packages and rows that are older are skipped and never billed. Use a UTC date (2026-10-01), a date and time (2026-10-01T12:00:00Z) or a relative value: 24h, 7d, 2w, 3mo, 1y, today, yesterday. Empty = no filter. To keep the free skipping cheap, a run stops after 600 skipped or unknown packages plus 400 for every package row delivered.",
            "default": ""
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of rows to return across packages, releases and feed items. Free users are limited to 10 rows (preview); paid users can set up to 1,000,000. Also acts as a spend cap, since each row is billed."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}