{
  "openapi": "3.0.1",
  "info": {
    "title": "Internet Archive Scraper (archive.org Items & Metadata)",
    "description": "Search the archive.org catalogue -- 40M+ texts, audio, movies, images, software and data. Solr query plus filters (media type, collection, creator, subject, year), sorted, up to 10,000 per query. Or fetch full metadata (with the file list) for specific identifiers. Keyless, no login.",
    "version": "0.1",
    "x-build-id": "oh5XnBHH18Fd9czoH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~internet-archive-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-internet-archive-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/scrapyx~internet-archive-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-internet-archive-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/scrapyx~internet-archive-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-internet-archive-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "items"
            ],
            "type": "string",
            "description": "`search` runs a query / filters against the archive.org catalogue (via the cursor scrape API — no 10k ceiling). `items` fetches full `/metadata` for specific identifiers.",
            "default": "search"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "`search` mode. Solr / Lucene syntax against all fields — `apollo 11`, `\"grateful dead\" AND year:[1977 TO 1977]`, `creator:(Charlie Chaplin)`. Optional if you supply filters instead. A malformed query does not error (Solr is lenient) — it just returns fewer results."
          },
          "identifiers": {
            "title": "Identifiers",
            "type": "array",
            "description": "`items` mode. One per line: an archive.org identifier (`nasa`, `gov.uscourts.dcd.178502`) or a `https://archive.org/details/...` / `/metadata/...` URL.",
            "items": {
              "type": "string"
            }
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "",
              "texts",
              "audio",
              "movies",
              "image",
              "software",
              "data",
              "web",
              "collection"
            ],
            "type": "string",
            "description": "`search` filter. One of: `texts`, `audio`, `movies`, `image`, `software`, `data`, `web`, `collection`. An unknown value is rejected.",
            "default": ""
          },
          "collection": {
            "title": "Collection",
            "type": "string",
            "description": "`search` filter. An archive.org collection identifier, e.g. `prelinger`, `librivoxaudio`, `opensource_movies`, `internetarchivebooks`, `nasa`."
          },
          "creator": {
            "title": "Creator",
            "type": "string",
            "description": "`search` filter. Matched against the `creator` field."
          },
          "subject": {
            "title": "Subject / keyword",
            "type": "string",
            "description": "`search` filter. Matched against the `subject` field."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "`search` filter. e.g. `English`, `eng`, `French`."
          },
          "uploader": {
            "title": "Uploader",
            "type": "string",
            "description": "`search` filter. The uploading account (usually an email)."
          },
          "fromYear": {
            "title": "From year",
            "type": "integer",
            "description": "`search` filter. Keep items with `year` >= this."
          },
          "toYear": {
            "title": "To year",
            "type": "integer",
            "description": "`search` filter. Keep items with `year` <= this."
          },
          "sort": {
            "title": "Sort",
            "type": "string",
            "description": "archive.org sort clause, e.g. `downloads desc`, `date desc`, `addeddate desc`, `avg_rating desc`, `titleSorter asc`. Default `downloads desc`.",
            "default": "downloads desc"
          },
          "rawQuery": {
            "title": "Raw query (power users)",
            "type": "string",
            "description": "Appended verbatim (AND-joined) to the composed query. Full Solr syntax."
          },
          "includeFiles": {
            "title": "Include file list (items mode)",
            "type": "boolean",
            "description": "`items` mode. Attach the item's full file list (name, format, size, length, md5, download URL) and `fileFormats`. Off by default — a large item can have hundreds of files.",
            "default": false
          },
          "slimOutput": {
            "title": "Slim output (drop raw)",
            "type": "boolean",
            "description": "By default every ITEM row carries the verbatim payload in `raw`. Turn on for the normalised fields only.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "`search` mode cap. Cursor pagination is used, so this can exceed 10,000 (`advancedsearch.php` would silently cap there).",
            "default": 500
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel in-flight requests (matters for `items` mode).",
            "default": 3
          },
          "minRequestInterval": {
            "title": "Min seconds between requests",
            "minimum": 0,
            "type": "number",
            "description": "Politeness pacing for archive.org's infrastructure.",
            "default": 0.5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. No anti-bot layer on the allowed endpoints, so a proxy is OFF by default.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}