{
  "openapi": "3.0.1",
  "info": {
    "title": "Crates.io Scraper",
    "description": "Scrape Crates.io with the official Rust package registry. Search crates, lookup by exact name, browse by category or keyword, list a user's crates, and pull reverse dependencies. Returns downloads, versions, licenses, repository URLs, categories, keywords, and more.",
    "version": "1.0",
    "x-build-id": "2P97GwkNEbm6Uakol"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~crates-io-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-crates-io-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/crawlerbros~crates-io-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-crates-io-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/crawlerbros~crates-io-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-crates-io-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byCrates",
              "byCategory",
              "byKeyword",
              "userCrates",
              "reverseDeps"
            ],
            "type": "string",
            "description": "What to fetch. `search` is a free-text query; `byCrates` looks up exact crate names; `byCategory` / `byKeyword` browse a taxonomy slug; `userCrates` lists everything published by a single crates.io user; `reverseDeps` lists crates that depend on a given crate (great for ecosystem analysis).",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Free-text query passed to the crates.io search API.",
            "default": "tokio"
          },
          "crateNames": {
            "title": "Crate names (mode=byCrates)",
            "type": "array",
            "description": "Exact crate names (e.g. `tokio`, `serde`, `clap`). URLs like `https://crates.io/crates/tokio` are also accepted.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "category": {
            "title": "Category (mode=byCategory or filter)",
            "enum": [
              "",
              "accessibility",
              "aerospace",
              "algorithms",
              "api-bindings",
              "artificial-intelligence",
              "asynchronous",
              "authentication",
              "automotive",
              "caching",
              "command-line-interface",
              "command-line-utilities",
              "compilers",
              "compression",
              "computer-vision",
              "concurrency",
              "config",
              "cryptography",
              "data-structures",
              "database",
              "database-implementations",
              "date-and-time",
              "development-tools",
              "email",
              "embedded",
              "emulators",
              "encoding",
              "external-ffi-bindings",
              "filesystem",
              "finance",
              "game-development",
              "game-engines",
              "games",
              "graphics",
              "gui",
              "hardware-support",
              "internationalization",
              "localization",
              "mathematics",
              "memory-management",
              "multimedia",
              "network-programming",
              "no-std",
              "os",
              "parser-implementations",
              "parsing",
              "rendering",
              "rust-patterns",
              "science",
              "security",
              "simulation",
              "template-engine",
              "text-editors",
              "text-processing",
              "value-formatting",
              "virtualization",
              "visualization",
              "wasm",
              "web-programming"
            ],
            "type": "string",
            "description": "Crates.io category slug. Used as the primary filter in `byCategory` mode; can also narrow `search` results.",
            "default": ""
          },
          "keyword": {
            "title": "Keyword (mode=byKeyword or filter)",
            "type": "string",
            "description": "Crates.io keyword tag. Used as the primary filter in `byKeyword` mode; can also narrow `search` results. Examples: `cli`, `async`, `wasm`, `parser`, `database`, `web`, `ai`, `llm`."
          },
          "userLogin": {
            "title": "User login (mode=userCrates)",
            "type": "string",
            "description": "Crates.io / GitHub username whose published crates you want (e.g. `dtolnay`, `seanmonstar`, `carllerche`)."
          },
          "sourceCrate": {
            "title": "Source crate (mode=reverseDeps)",
            "type": "string",
            "description": "Crate name whose reverse dependencies you want to list (e.g. `clap`, `rand`, `regex`). Note: a few extremely popular crates (e.g. `serde`, `serde_json`, `tokio`) cause the upstream reverse_dependencies endpoint to return 500 / time out; pick a smaller crate."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "alphabetical",
              "recent-updates",
              "recent-downloads",
              "downloads",
              "new"
            ],
            "type": "string",
            "description": "How to order results returned by the crates.io API.",
            "default": "relevance"
          },
          "minDownloads": {
            "title": "Min all-time downloads",
            "minimum": 0,
            "maximum": 10000000000,
            "type": "integer",
            "description": "Drop crates with fewer all-time downloads than this."
          },
          "maxDownloads": {
            "title": "Max all-time downloads",
            "minimum": 0,
            "maximum": 10000000000,
            "type": "integer",
            "description": "Drop crates with more all-time downloads than this."
          },
          "minRecentDownloads": {
            "title": "Min recent downloads (90 days)",
            "minimum": 0,
            "maximum": 10000000000,
            "type": "integer",
            "description": "Drop crates whose 90-day download count is below this."
          },
          "maxRecentDownloads": {
            "title": "Max recent downloads (90 days)",
            "minimum": 0,
            "maximum": 10000000000,
            "type": "integer",
            "description": "Drop crates whose 90-day download count is above this."
          },
          "minVersionCount": {
            "title": "Min version count",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Drop crates with fewer published versions than this."
          },
          "maxVersionCount": {
            "title": "Max version count",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Drop crates with more published versions than this."
          },
          "updatedSinceDays": {
            "title": "Updated since (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Drop crates whose latest update is older than this many days. Useful for `recently maintained` searches."
          },
          "containsKeyword": {
            "title": "Contains keyword (substring)",
            "type": "string",
            "description": "Case-insensitive substring filter applied to name / description / id / keywords."
          },
          "includeVersions": {
            "title": "Include version history",
            "type": "boolean",
            "description": "Fetch and emit the full version list per crate (up to 50 versions). Adds one extra API call per crate.",
            "default": false
          },
          "includeOwners": {
            "title": "Include owners",
            "type": "boolean",
            "description": "Fetch and emit owner users + teams per crate. Adds two extra API calls per crate.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}