{
  "openapi": "3.0.1",
  "info": {
    "title": "Public Domain Ebook RAG Feed",
    "description": "Public-domain books for RAG/LLM pipelines from Project Gutenberg's catalog and Open Library. Clean chunked text, author death years and an EU life+70 public-domain status per book.",
    "version": "0.2",
    "x-build-id": "uIKNi9kPVzF2ruSyL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codeclouds~public-domain-ebook-rag-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codeclouds-public-domain-ebook-rag-feed",
        "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/codeclouds~public-domain-ebook-rag-feed/runs": {
      "post": {
        "operationId": "runs-sync-codeclouds-public-domain-ebook-rag-feed",
        "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/codeclouds~public-domain-ebook-rag-feed/run-sync": {
      "post": {
        "operationId": "run-sync-codeclouds-public-domain-ebook-rag-feed",
        "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": {
          "search": {
            "title": "Search query",
            "type": "string",
            "description": "Words that must all appear in the title or author names (case-insensitive). Empty = no text filter."
          },
          "languages": {
            "title": "Languages (ISO 639-1)",
            "type": "array",
            "description": "Filter by language codes (e.g., ['en', 'fr', 'de']). Empty = all languages.",
            "items": {
              "type": "string",
              "pattern": "^[a-z]{2}$"
            }
          },
          "subjects": {
            "title": "Subjects / Genres",
            "type": "array",
            "description": "Keep books whose subjects or bookshelves contain any of these terms (e.g., ['Science fiction', 'History']). Empty = all subjects.",
            "items": {
              "type": "string"
            }
          },
          "copyright": {
            "title": "Copyright status",
            "type": "boolean",
            "description": "Filter by copyright flag. false = public domain in the US (default), true = not confirmed public domain. Full text is only ever fetched for public-domain books.",
            "default": false
          },
          "euPublicDomainOnly": {
            "title": "EU public domain only",
            "type": "boolean",
            "description": "Keep only books that are likely public domain in the EU too (every author and translator died more than 70 years ago). Books with an unknown death year are excluded. Most useful with the Gutenberg source, which includes death years.",
            "default": false
          },
          "limit": {
            "title": "Max books to fetch",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of books to retrieve. 0 = no limit (fetch all matching).",
            "default": 100
          },
          "mode": {
            "title": "Fetch mode",
            "enum": [
              "full",
              "watchlist"
            ],
            "type": "string",
            "description": "full = complete catalog dump (default); watchlist = only new additions since last run (requires persistent storage).",
            "default": "full"
          },
          "sources": {
            "title": "Data sources",
            "type": "array",
            "description": "Which public-domain catalogs to include. gutenberg = the official Project Gutenberg catalog (78,000+ texts, clean plain text via the official mirror, author death years). openlibrary = Open Library search with Internet Archive OCR text for public-domain scans. standard-ebooks is currently skipped (its catalog feed requires a paid membership).",
            "items": {
              "type": "string",
              "enum": [
                "gutenberg",
                "openlibrary",
                "standard-ebooks"
              ]
            },
            "default": [
              "gutenberg",
              "openlibrary"
            ]
          },
          "chunking": {
            "title": "RAG chunking options",
            "type": "object",
            "description": "Configure text chunking for RAG pipelines. Omit or set enabled=false to output full book text.",
            "properties": {
              "enabled": {
                "title": "Enable chunking",
                "type": "boolean",
                "default": true,
                "description": "Enable chunking (output one dataset item per chunk instead of per book)."
              },
              "strategy": {
                "title": "Chunking strategy",
                "type": "string",
                "enum": [
                  "chapter",
                  "paragraph",
                  "fixed"
                ],
                "default": "chapter",
                "description": "chapter = split on double newlines (a proxy for chapter breaks); paragraph = split by blank lines; fixed = fixed character window."
              },
              "maxChunkChars": {
                "title": "Max chunk characters",
                "type": "integer",
                "default": 2000,
                "minimum": 200,
                "maximum": 10000,
                "description": "Maximum characters per chunk (for fixed/paragraph strategies)."
              },
              "overlapChars": {
                "title": "Overlap characters",
                "type": "integer",
                "default": 200,
                "minimum": 0,
                "maximum": 1000,
                "description": "Character overlap between adjacent chunks."
              }
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}