{
  "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": "MeontkXMdvodeQF36"
  },
  "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 or URLs",
            "type": "array",
            "description": "Packages to scrape, one per line. Accepts names, pypi.org project URLs or requirements.txt lines. Example: requests, https://pypi.org/project/flask/, django>=5. Leave empty only if you use the top list or the name search below.",
            "default": [
              "requests",
              "numpy",
              "flask"
            ],
            "items": {
              "type": "string"
            }
          },
          "topN": {
            "title": "Add the N most downloaded packages",
            "minimum": 0,
            "maximum": 15000,
            "type": "integer",
            "description": "How many of the top PyPI packages of the last 30 days to add (monthly top-15,000 list). Example: 100. 0 = off. Adds topRank and topDownloads30d columns.",
            "default": 0
          },
          "topStartRank": {
            "title": "Top list: start at rank",
            "minimum": 1,
            "maximum": 15000,
            "type": "integer",
            "description": "First rank to take, where 1 = most downloaded. Example: 101 with 100 packages gives ranks 101 to 200, handy to split a big pull into several runs.",
            "default": 1
          },
          "searchQueries": {
            "title": "Search texts in package names",
            "type": "array",
            "description": "Texts to find inside package names, ignoring case and - _ . differences. Example: scraper or django-rest. At least 3 characters. Names only, not summaries. Leave empty to skip.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchMaxResultsPerQuery": {
            "title": "Packages to keep per search text",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many matches to take for each search text, best ranked first. Example: 20.",
            "default": 20
          },
          "includeDownloadStats": {
            "title": "Download counts (day, week, month)",
            "type": "boolean",
            "description": "Adds pypistats.org counts to each package. Slows the run to about 1 package per second (pypistats limit of 60 requests per minute). Turn off for 3 to 6 packages per second.",
            "default": true
          },
          "includeReleaseHistory": {
            "title": "One row per released version",
            "type": "boolean",
            "description": "Adds a row for every release with date, files, wheel/source availability, sizes, Python tags and yank reason. Each release row is billed like a release record.",
            "default": false
          },
          "includeDescription": {
            "title": "Full project description (README text)",
            "type": "boolean",
            "description": "Adds the long description of the latest release, cut at 20,000 characters, as longDescription. Makes rows much larger.",
            "default": false
          },
          "includeNewestPackagesFeed": {
            "title": "Newest packages on PyPI (feed)",
            "type": "boolean",
            "description": "Adds about 40 rows of brand-new packages: name, summary, author email, publish time.",
            "default": false
          },
          "includeLatestUpdatesFeed": {
            "title": "Latest version updates on PyPI (feed)",
            "type": "boolean",
            "description": "Adds about 100 rows of the latest releases across PyPI: name, new version, summary, author email, publish time.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows to return",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum rows across packages, releases and feed items. Example: 100. Free plan: 10 rows (preview). Paid plans: up to 1,000,000. Each row is billed, so this is also your spend cap."
          },
          "onlyNewSince": {
            "title": "Only releases since (date or age)",
            "type": "string",
            "description": "Keep only packages released at or after this moment; older ones are skipped and never billed. Example: 7d, 24h, 2026-10-01 or 2026-10-01T12:00:00Z. Empty = no filter.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}