{
  "openapi": "3.0.1",
  "info": {
    "title": "Ai Training Data Curator",
    "description": "Crawl websites and curate high-quality training data for LLM fine-tuning. Automatic deduplication, quality scoring, and language detection. Export to JSONL, Parquet, or CSV formats ready for OpenAI, Claude, or Llama training.",
    "version": "1.1",
    "x-build-id": "5uAj1uayEGy3AmThH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/omarchydev~ai-training-data-curator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-omarchydev-ai-training-data-curator",
        "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/omarchydev~ai-training-data-curator/runs": {
      "post": {
        "operationId": "runs-sync-omarchydev-ai-training-data-curator",
        "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/omarchydev~ai-training-data-curator/run-sync": {
      "post": {
        "operationId": "run-sync-omarchydev-ai-training-data-curator",
        "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": {
          "start_urls": {
            "title": "Start URLs",
            "type": "array",
            "description": "URLs to start crawling from. Leave empty if using BYOD mode.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "documents": {
            "title": "Documents (BYOD)",
            "type": "array",
            "description": "Your own documents to process. Provide text strings or objects with 'text' field. Use this instead of Start URLs for BYOD mode."
          },
          "byod_text_field": {
            "title": "Text Field Name (BYOD)",
            "type": "string",
            "description": "Field name containing text in BYOD documents (default: 'text')",
            "default": "text"
          },
          "max_byod_documents": {
            "title": "Max BYOD Documents",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum documents to process in BYOD mode (prevents memory issues)",
            "default": 500
          },
          "crawl_mode": {
            "title": "Crawl Mode",
            "enum": [
              "single_page",
              "same_domain",
              "same_subdomain",
              "all_links"
            ],
            "type": "string",
            "description": "How extensively to crawl: single_page, same_domain, same_subdomain, all_links",
            "default": "same_domain"
          },
          "max_pages": {
            "title": "Maximum Pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of pages to crawl",
            "default": 100
          },
          "max_depth": {
            "title": "Maximum Depth",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum link depth from start URLs",
            "default": 3
          },
          "content_selectors": {
            "title": "Content Selectors",
            "type": "array",
            "description": "CSS selectors for main content elements (e.g., article, main, .content)",
            "items": {
              "type": "string"
            }
          },
          "exclude_selectors": {
            "title": "Exclude Selectors",
            "type": "array",
            "description": "CSS selectors for elements to exclude (e.g., nav, footer, .sidebar)",
            "items": {
              "type": "string"
            }
          },
          "min_word_count": {
            "title": "Minimum Word Count",
            "minimum": 10,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum words per document",
            "default": 100
          },
          "max_word_count": {
            "title": "Maximum Word Count",
            "minimum": 100,
            "maximum": 500000,
            "type": "integer",
            "description": "Maximum words per document (longer documents will be truncated)",
            "default": 50000
          },
          "deduplicate": {
            "title": "Enable Deduplication",
            "type": "boolean",
            "description": "Remove near-duplicate documents using fuzzy matching",
            "default": true
          },
          "dedup_threshold_percent": {
            "title": "Deduplication Threshold (%)",
            "minimum": 50,
            "maximum": 100,
            "type": "integer",
            "description": "Similarity threshold for deduplication (50-100%, higher = stricter)",
            "default": 85
          },
          "quality_filter": {
            "title": "Enable Quality Filter",
            "type": "boolean",
            "description": "Filter out low-quality documents based on quality score",
            "default": true
          },
          "min_quality_score_percent": {
            "title": "Minimum Quality Score (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum quality score to include document (0-100%)",
            "default": 50
          },
          "language_filter": {
            "title": "Language Filter",
            "type": "array",
            "description": "Language codes to include (e.g., en, es, fr). Empty = all languages",
            "items": {
              "type": "string"
            }
          },
          "chunk_documents": {
            "title": "Chunk Documents",
            "type": "boolean",
            "description": "Split documents into smaller chunks for training",
            "default": false
          },
          "chunk_size": {
            "title": "Chunk Size",
            "minimum": 64,
            "maximum": 8192,
            "type": "integer",
            "description": "Target tokens per chunk when chunking is enabled",
            "default": 512
          },
          "chunk_overlap": {
            "title": "Chunk Overlap",
            "minimum": 0,
            "maximum": 512,
            "type": "integer",
            "description": "Overlap tokens between consecutive chunks",
            "default": 64
          },
          "output_format": {
            "title": "Output Format",
            "enum": [
              "jsonl",
              "json",
              "csv"
            ],
            "type": "string",
            "description": "Format for output data",
            "default": "jsonl"
          },
          "text_field_name": {
            "title": "Text Field Name",
            "type": "string",
            "description": "Field name for text content in output",
            "default": "text"
          },
          "include_metadata": {
            "title": "Include Metadata",
            "type": "boolean",
            "description": "Include document metadata (title, author, URL, etc.)",
            "default": true
          },
          "include_raw_html": {
            "title": "Include Raw HTML",
            "type": "boolean",
            "description": "Include raw HTML in output (increases data size)",
            "default": false
          },
          "remove_urls": {
            "title": "Remove URLs from Text",
            "type": "boolean",
            "description": "Remove URLs from extracted text",
            "default": false
          },
          "remove_emails": {
            "title": "Remove Emails from Text",
            "type": "boolean",
            "description": "Remove email addresses from extracted text (recommended for privacy)",
            "default": true
          },
          "normalize_whitespace": {
            "title": "Normalize Whitespace",
            "type": "boolean",
            "description": "Normalize whitespace and remove excessive blank lines",
            "default": true
          },
          "use_proxies": {
            "title": "Use Proxies",
            "type": "boolean",
            "description": "Use Apify proxy for requests",
            "default": false
          },
          "max_concurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum concurrent page requests",
            "default": 10
          },
          "request_delay_ms": {
            "title": "Request Delay (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Delay between requests in milliseconds",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}