{
  "openapi": "3.0.1",
  "info": {
    "title": "Internet Archive Scraper - Books, Media & Wayback Snapshots",
    "description": "Search archive.org for books, movies, audio, software, and images, read full item metadata and file lists, and list Wayback Machine snapshots for any URL.",
    "version": "1.0",
    "x-build-id": "tZpRuHgdk2SW3z2lg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thirdwatch~internet-archive-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thirdwatch-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/thirdwatch~internet-archive-scraper/runs": {
      "post": {
        "operationId": "runs-sync-thirdwatch-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/thirdwatch~internet-archive-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-thirdwatch-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to collect",
            "enum": [
              "search",
              "item",
              "wayback"
            ],
            "type": "string",
            "description": "Search the archive, read metadata for known items, or list Wayback Machine snapshots for a URL.",
            "default": "search"
          },
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "Free text or an archive.org query such as creator:\"NASA\" AND subject:\"mars\". Used in search mode.",
            "default": ""
          },
          "mediaTypes": {
            "title": "Media types",
            "type": "array",
            "description": "Restrict search results to these media types. Leave empty for everything.",
            "items": {
              "type": "string",
              "enum": [
                "texts",
                "movies",
                "audio",
                "software",
                "image",
                "etree",
                "data",
                "web",
                "collection"
              ],
              "enumTitles": [
                "Books and texts",
                "Movies and video",
                "Audio and music",
                "Software",
                "Images",
                "Live music archive",
                "Data",
                "Web archives",
                "Collections"
              ]
            },
            "default": []
          },
          "collection": {
            "title": "Collection",
            "type": "string",
            "description": "Restrict search results to one archive.org collection, such as nasa or librivoxaudio.",
            "default": ""
          },
          "creator": {
            "title": "Creator",
            "type": "string",
            "description": "Restrict search results to one creator, author, or uploader.",
            "default": ""
          },
          "subject": {
            "title": "Subject",
            "type": "string",
            "description": "Restrict search results to one subject tag.",
            "default": ""
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Restrict search results to one language, such as English or spa.",
            "default": ""
          },
          "yearFrom": {
            "title": "Year from",
            "minimum": 1,
            "maximum": 2100,
            "type": "integer",
            "description": "Earliest publication year to include in search results."
          },
          "yearTo": {
            "title": "Year to",
            "minimum": 1,
            "maximum": 2100,
            "type": "integer",
            "description": "Latest publication year to include in search results."
          },
          "sort": {
            "title": "Sort search results by",
            "enum": [
              "",
              "downloads desc",
              "downloads asc",
              "publicdate desc",
              "publicdate asc",
              "addeddate desc",
              "date desc",
              "item_size desc",
              "identifier asc"
            ],
            "type": "string",
            "description": "Order of returned search results.",
            "default": ""
          },
          "identifiers": {
            "title": "Item identifiers",
            "type": "array",
            "description": "archive.org identifiers to read metadata and file lists for. Used in item mode.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^/\\s]+$"
            },
            "default": []
          },
          "maxFilesPerItem": {
            "title": "Maximum files per item",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many files to list inside each item record in item mode.",
            "default": 50
          },
          "urls": {
            "title": "URLs for the Wayback Machine",
            "type": "array",
            "description": "URLs or domains to list archived snapshots for. Used in wayback mode.",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 2000
            },
            "default": []
          },
          "waybackMatchType": {
            "title": "Wayback URL match",
            "enum": [
              "exact",
              "prefix",
              "host",
              "domain"
            ],
            "type": "string",
            "description": "How broadly to match the URL when listing snapshots.",
            "default": "exact"
          },
          "waybackCollapse": {
            "title": "Collapse duplicate snapshots",
            "enum": [
              "",
              "timestamp:4",
              "timestamp:6",
              "timestamp:8",
              "digest"
            ],
            "type": "string",
            "description": "Keep one snapshot per period or per unique content instead of every capture.",
            "default": "timestamp:6"
          },
          "waybackFrom": {
            "title": "Wayback from",
            "pattern": "^$|^[0-9]{4}([0-9]{2})?([0-9]{2})?$",
            "type": "string",
            "description": "Earliest capture date as YYYY, YYYYMM, or YYYYMMDD.",
            "default": ""
          },
          "waybackTo": {
            "title": "Wayback to",
            "pattern": "^$|^[0-9]{4}([0-9]{2})?([0-9]{2})?$",
            "type": "string",
            "description": "Latest capture date as YYYY, YYYYMM, or YYYYMMDD.",
            "default": ""
          },
          "waybackStatusCode": {
            "title": "Only this HTTP status",
            "pattern": "^$|^[1-5][0-9]{2}$",
            "type": "string",
            "description": "Keep only snapshots captured with this status code, such as 200.",
            "default": ""
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Upper bound on saved records. archive.org caps search paging at 10,000 results per query.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}