{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenLibrary Books Scraper",
    "description": "Book catalogue data from the Internet Archive's OpenLibrary: full-text search, subject/genre browsing, and rich work detail (description, subjects, linked authors), with identifiers, ratings and ebook availability via its own public API.",
    "version": "0.1",
    "x-build-id": "DKxbrxZBEcXyPaSAG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~openlibrary-books-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-openlibrary-books-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~openlibrary-books-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-openlibrary-books-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~openlibrary-books-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-openlibrary-books-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": {
          "searchQueries": {
            "title": "Search queries (free text)",
            "type": "array",
            "description": "Full-text catalogue search, e.g. 'dune frank herbert'. Each query gets its own SEARCH_SUMMARY + BOOK rows. Pagination is REAL on this endpoint (verified: no overlap between pages), so this actor pages through results up to 'maxItemsPerQuery' rather than a single fetch. A nonsense query returns an honest empty result (numFound: 0), never a silently-widened catalogue.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subjectQueries": {
            "title": "Subject/genre slugs to browse",
            "type": "array",
            "description": "Browse works tagged with a subject, e.g. 'science_fiction', 'fantasy', 'poetry'. Slugs are OpenLibrary's own (lowercase, spaces as underscores) -- browse https://openlibrary.org/subjects to find one. Each entry gets its own SEARCH_SUMMARY + BOOK rows, paged the same way as search. An unrecognised slug returns an honest work_count: 0, not a fallback to a different subject.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "workLookups": {
            "title": "Work lookups (OpenLibrary work id)",
            "type": "array",
            "description": "Full detail for one work by its OpenLibrary id (e.g. 'OL893414W', with or without a '/works/' prefix or '.json' suffix -- all accepted). Adds a full description, complete subject list, and linked author keys beyond what search/subject rows carry. A bad id is reported as a clean not_found ERROR row. Some ids are stale/merged and redirect to a canonical id -- followed automatically once, noted via '_redirectedFrom'.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchFields": {
            "title": "Search result fields (advanced, optional)",
            "type": "array",
            "description": "Override which fields the search API returns per BOOK row (only affects 'searchQueries', not 'subjectQueries' or 'workLookups'). Leave empty for this actor's curated default field set (identifiers, ratings, ebook availability -- see README). Pass ['*'] for upstream's full raw field set, which additionally includes ~50 hour-of-day/day-of-week trending-score columns.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItemsPerQuery": {
            "title": "Max rows per query",
            "minimum": 0,
            "type": "integer",
            "description": "Caps rows per search/subject query, paging as needed to reach it (up to 100 rows per request, OpenLibrary's own practical per-request cap). 0 = no explicit cap (still bounded by a 50-page safety net). Does not apply to 'workLookups' (always exactly one row per id).",
            "default": 50
          },
          "maxConcurrency": {
            "title": "Max concurrent requests",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "How many requests may be in flight at once. This absorbs latency variance; it is NOT the throttle — the crawl rate is set by 'Minimum interval between requests' below.",
            "default": 5
          },
          "minRequestInterval": {
            "title": "Minimum interval between requests (seconds)",
            "minimum": 0.05,
            "maximum": 30,
            "type": "number",
            "description": "The actual speed control: the shortest gap between two requests, across all workers. openlibrary.org's own robots.txt sets a 10-second crawl-delay specifically for the ClaudeBot/anthropic-ai groups (not a technical WAF limit -- no WAF was observed); this default of 10 honors that policy signal directly rather than just the minimum a rate-limiter would force.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential with no country pin is the cloud default. No WAF was observed during testing (5/5 TLS profiles clean, byte-identical responses), and this actor's identity is explicitly welcomed by openlibrary.org's own robots.txt.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}