{
  "openapi": "3.0.1",
  "info": {
    "title": "Internet Archive API — Search, Metadata & Files",
    "description": "Search archive.org and get its catalogue as data. One row per item: identifier, title, creators, date, subjects, collections, language, downloads, size and licence. Optional rows per file with direct download URLs, formats, sizes and checksums, and per public review. No API key, no login.",
    "version": "0.1",
    "x-build-id": "Y5RaDa9ofBy1rtO5N"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/insight.solutions~internet-archive-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-insight.solutions-internet-archive-api",
        "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/insight.solutions~internet-archive-api/runs": {
      "post": {
        "operationId": "runs-sync-insight.solutions-internet-archive-api",
        "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/insight.solutions~internet-archive-api/run-sync": {
      "post": {
        "operationId": "run-sync-insight.solutions-internet-archive-api",
        "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": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "One entry per search, in the Internet Archive's own query language. Field searches — `collection:librivoxaudio`, `creator:\"Jane Austen\"`, `subject:\"machine learning\"`, `uploader:someone@example.com` — can be combined with `AND`, `OR` and `NOT`, and plain words search everything. Every hit becomes one `item` row. Leave this empty and pass `identifiers` instead if you already know which items you want.",
            "items": {
              "type": "string"
            }
          },
          "identifiers": {
            "title": "Item identifiers or archive.org URLs",
            "type": "array",
            "description": "Items to read directly, as bare identifiers (`nasa_techdoc_19930072988`) or full links (`https://archive.org/details/nasa_techdoc_19930072988`). Each one is read from the Archive's metadata API, which returns the complete record — licence, uploader, added date, file count — rather than the shorter record the search index holds. Identifiers are case-sensitive. Wayback Machine capture URLs are not items and are rejected with an explanation.",
            "items": {
              "type": "string"
            }
          },
          "mediaType": {
            "title": "Media type",
            "enum": [
              "any",
              "texts",
              "audio",
              "movies",
              "image",
              "software",
              "data",
              "web"
            ],
            "type": "string",
            "description": "Narrow every search query to one kind of item. This is appended to your query as `AND mediatype:…` — but only when the query does not already name a media type of its own, because two `mediatype:` clauses can never both match. It does not affect `identifiers`.",
            "default": "any"
          },
          "sort": {
            "title": "Result order",
            "enum": [
              "relevance",
              "downloads",
              "date",
              "publicdate",
              "title"
            ],
            "type": "string",
            "description": "How the Archive should order each query's results. `relevance` is the index's own default and the fastest. `downloads` puts the most-downloaded items first, which is the closest thing the Archive has to a popularity ranking. `date` is the item's own date (when the thing was made); `publicdate` is when it was uploaded. If the index refuses a sort, the query is retried once in the default order rather than returning nothing, and the run log says so.",
            "default": "relevance"
          },
          "dateFrom": {
            "title": "Item date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Keep only items whose own `date` is on or after this day. It is added to every search query as `AND date:[from TO to]`, and either end can be left empty for an open range. This is the date of the thing itself — when the film was shot, the book published — not when it was uploaded. Anything that is not a `YYYY-MM-DD` day is ignored rather than sent to the index as a syntax error."
          },
          "dateTo": {
            "title": "Item date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Keep only items whose own `date` is on or before this day. Pairs with `dateFrom`; either can be used alone."
          },
          "maxResultsPerQuery": {
            "title": "Results per query",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How many items to return for each search query. The Archive's search index is read a hundred results per page, so a run for ten results reads one page and keeps ten — and the walk stops on the page that reaches your number. Set 0 for everything the query matches, up to the index's own ceiling of 10,000 results per query: it will not page past that, and the run log says so when a walk stops there.",
            "default": 100
          },
          "includeFiles": {
            "title": "Include file rows",
            "type": "boolean",
            "description": "Return one `file` row per file on each item in `identifiers`: name, direct download URL, format, whether it is the original upload or a derivative the Archive made from it, size, MD5 and SHA-1, duration, dimensions and track number. Items have far more files than people expect — a 50-chapter audiobook carries 377 — so this is off by default and bounded by `maxFilesPerItem`. It does not apply to search hits.",
            "default": false
          },
          "maxFilesPerItem": {
            "title": "Maximum file rows per item",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "The ceiling on `file` rows for one item, applied after `fileFormats` has filtered the list — so a cap of 20 with a format filter gives you 20 of the files you asked for, not 20 of everything. Set 0 for no ceiling.",
            "default": 200
          },
          "fileFormats": {
            "title": "Only these file formats",
            "type": "array",
            "description": "Keep only files matching these formats. Matching is case-insensitive against the Archive's own format label and against the file extension, and a single word matches every variant of it: `MP3` keeps both `VBR MP3` and `64Kbps MP3`, `PDF` keeps `Text PDF`. Leave empty to keep every file, originals and derivatives alike.",
            "items": {
              "type": "string"
            }
          },
          "includeReviews": {
            "title": "Include review rows",
            "type": "boolean",
            "description": "Return one `review` row per public review on each item in `identifiers`: reviewer, their Archive account, title, body, star rating and date. The metadata record already carries an item's reviews, so this usually costs no extra request. It does not apply to search hits.",
            "default": false
          },
          "includeMetadataForSearchHits": {
            "title": "Fill in search hits from the metadata API",
            "type": "boolean",
            "description": "Search hits come from the Archive's index, which holds a shorter record than the item itself: no licence, no uploader, no added date, no file count, and a description with its formatting flattened. Turning this on fetches the full record for every hit — **one extra request per hit**, so a hundred results means a hundred requests and a much longer run. Off by default. The columns the index does have (`downloads`, `avgRating`, `numReviews`) are kept either way.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Queries and items in parallel",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many search queries and identifiers are read at once. Each parallel worker keeps its own proxy session, so a worker that gets rate-limited burns only its own exit IP. Pages *within* one query are read one after another, not in parallel. Three is deliberate: the Archive is a non-profit serving these endpoints for free, and this is a rate that reads it rather than hammering it.",
            "default": 3
          },
          "maxRunSecs": {
            "title": "Maximum run time (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Wall-clock budget for the whole run. When it is reached the Actor stops walking, keeps and bills for every row it already wrote, and files a free diagnostic row for each entry it never reached. A query stopped part-way keeps its rows and is not marked as failed. Nothing is charged for work that did not happen.",
            "default": 240
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "The Archive serves these endpoints to datacenter addresses, so the default is Apify's datacenter proxy — the same data at a fraction of the traffic cost, and its cost is already inside the per-item price. Switch to residential only if you are pulling tens of thousands of items and start seeing `blocked` rows. Sessions rotate automatically when an exit IP is refused.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}