{
  "openapi": "3.0.1",
  "info": {
    "title": "DTS Text Services Extractor",
    "description": "Point at ANY Distributed Text Services (DTS) endpoint — DraCor, Perseids, DoTS and the TEI text-corpus world — and extract it: browse the collection tree, list a text's citeable references, or fetch the TEI/XML of any passage. One actor for digital-humanities texts.",
    "version": "0.1",
    "x-build-id": "zPkM0eScuR6zAd9SY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~dts-text-services-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-dts-text-services-extractor",
        "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/datamule~dts-text-services-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-dts-text-services-extractor",
        "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/datamule~dts-text-services-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-dts-text-services-extractor",
        "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": [
          "entryUrl"
        ],
        "properties": {
          "entryUrl": {
            "title": "DTS entry / base URL",
            "type": "string",
            "description": "The entry (base) URL of ANY Distributed Text Services (DTS) endpoint. ONE actor speaks to all of them — DraCor (https://dev.dracor.org/api/v1/dts), Perseids (https://dts.perseids.org), the École des chartes DoTS (https://dots.chartes.psl.eu/demo/api/dts) and the growing set of TEI text repositories. The actor reads this entry document and resolves the real Collection / Navigation / Document endpoints from its URI templates, so paths that differ per host (‘/api/v1/dts/collection’ vs ‘/collections’) all work. You can also pass a service's Collection / Navigation / Document URL directly."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "collection",
              "navigation",
              "document"
            ],
            "type": "string",
            "description": "Which DTS endpoint to read. ‘collection’ browses the corpus tree (child collections + readable resources with Dublin Core metadata). ‘navigation’ lists the citeable references (front / body / act / scene …) of one resource. ‘document’ fetches the actual TEI/XML text of a resource or one passage.",
            "default": "collection"
          },
          "collectionId": {
            "title": "Collection id (collection mode)",
            "type": "string",
            "description": "Collection mode only. The ‘@id’ of a specific collection to descend into (sent as the DTS Collection ‘id’ parameter). Leave empty to start at the service's top collection. Example (DraCor): https://dev.dracor.org/id/ger"
          },
          "resource": {
            "title": "Resource identifier (navigation / document mode)",
            "type": "string",
            "description": "Navigation and Document modes require this: the identifier of the readable resource to navigate or fetch (the ‘@id’ of a Resource member from collection mode). Example (DraCor): https://dev.dracor.org/id/ger000171"
          },
          "ref": {
            "title": "Citation ref (navigation / document mode)",
            "type": "string",
            "description": "Optional. A single citation reference to target — the ‘ref’ of a CitableUnit (e.g. ‘body’, ‘1.1’). In navigation mode, lists the children of this ref; in document mode, returns just this passage's TEI/XML. Leave empty for the whole resource."
          },
          "start": {
            "title": "Range start ref (navigation / document mode)",
            "type": "string",
            "description": "Optional. The start of a citation range (used with ‘end’) to select a span of passages, e.g. start=1 end=3. Overridden by ‘ref’ when both are set."
          },
          "end": {
            "title": "Range end ref (navigation / document mode)",
            "type": "string",
            "description": "Optional. The end of a citation range (used with ‘start’)."
          },
          "down": {
            "title": "Navigation depth (navigation mode)",
            "type": "integer",
            "description": "Navigation mode only. How many citation levels below the target to return (the DTS ‘down’ parameter): 1 = the immediate children, 2 = children + grandchildren, -1 = the full tree. Defaults to 1 when no ref/range is given."
          },
          "mediaType": {
            "title": "Media type (document mode)",
            "type": "string",
            "description": "Optional DTS ‘mediaType’ for the Document endpoint (e.g. ‘application/tei+xml’, ‘text/plain’). Leave empty to use the service's default (usually TEI/XML). Not all services honour every value."
          },
          "maxDepth": {
            "title": "Max collection recursion depth (collection mode)",
            "minimum": 0,
            "type": "integer",
            "description": "Collection mode only. How many levels of child collections to descend into. 0 = only the members of the requested collection (no recursion). 1 (default) = also expand each child collection one level. Deeper values traverse more of the corpus tree (and cost more, one billable record per member).",
            "default": 1
          },
          "maxRecords": {
            "title": "Max records (global cap)",
            "minimum": 1,
            "type": "integer",
            "description": "A GLOBAL cap on the number of records emitted (each record is one billable event). Reached mid-traversal, the run stops deterministically. Default 1000.",
            "default": 1000
          },
          "userAgent": {
            "title": "User-Agent override",
            "type": "string",
            "description": "Optional override for the request User-Agent. A descriptive User-Agent is sent by default — some repositories throttle or reject a blank / generic UA. Only override if a specific service asks you to identify differently."
          },
          "timeoutSecs": {
            "title": "Read timeout (seconds)",
            "minimum": 1,
            "maximum": 900,
            "type": "integer",
            "description": "How long to wait for the service to answer (default 120). Fetching a large TEI document or a deep navigation tree can be slow."
          },
          "bearer": {
            "title": "Bearer token",
            "type": "string",
            "description": "Optional bearer token for an auth-gated DTS deployment (sent as Authorization: Bearer ***). NOT required for public services. Never logged."
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers as a JSON object, e.g. {\"X-Api-Key\": \"...\"} for a gateway-fronted service. Not required for public services. Header values are never logged."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}