{
  "openapi": "3.0.1",
  "info": {
    "title": "Language Detector: Detect Text Language in Bulk (API)",
    "description": "Language detector API: detect the language of texts, web pages and dataset fields in bulk. ISO 639-1 code and name, confidence, top 3 candidates, script, reliability flag and optional mixed-language detection by sentence.",
    "version": "0.1",
    "x-build-id": "SzKiaGg5qM491zeIx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~language-detector/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-language-detector",
        "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/data-done-right~language-detector/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-language-detector",
        "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/data-done-right~language-detector/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-language-detector",
        "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": {
          "texts": {
            "title": "Texts",
            "type": "array",
            "description": "Texts to detect, one per line. Each line is one result row. Example: Bonjour tout le monde, comment allez-vous aujourd'hui ?",
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "Page URLs (optional)",
            "type": "array",
            "description": "Web pages whose main text should be analysed. The page html lang attribute is returned as a second signal. Public pages only, no logins. Example: https://en.wikipedia.org/wiki/Language.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset with texts (optional)",
            "type": "string",
            "description": "Optional. Pick an Apify dataset (for example the output of a scraper) and the field below is analysed for every item. Example: a dataset ID such as aBcD1234eFgH5678i."
          },
          "datasetField": {
            "title": "Dataset field",
            "type": "string",
            "description": "Field of each dataset item that holds the text (or a list of texts). Dotted paths work. Example: review.text or comments.0. Default: text.",
            "default": "text"
          },
          "detectMixed": {
            "title": "Detect mixed languages",
            "type": "boolean",
            "description": "Also split each text into sentences and detect every sentence, so a text that switches language returns a list of languages with their share. Example: true for bilingual reviews or emails. Needs texts of at least 20 characters.",
            "default": false
          },
          "restrictToLanguages": {
            "title": "Only choose between these languages",
            "type": "array",
            "description": "Optional. Limit the answer to these languages (2-letter ISO 639-1 codes, at least two). This makes short texts much more accurate when you know the likely languages. Example: en, fr, de. Leave empty for all 75 languages.",
            "items": {
              "type": "string"
            }
          },
          "accuracy": {
            "title": "Accuracy",
            "enum": [
              "high",
              "fast"
            ],
            "type": "string",
            "description": "High uses the full language models (best on short texts, needs more memory and about 10-20 s to start). Fast uses a lighter mode that is quicker but less accurate on short texts. Example: high.",
            "default": "high"
          },
          "reliableThreshold": {
            "title": "Reliable confidence",
            "minimum": 0.1,
            "maximum": 0.99,
            "type": "number",
            "description": "A result is flagged isReliable when its confidence is at least this value (and the text is 20+ characters). Range 0.1 to 0.99. Example: 0.7.",
            "default": 0.7
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum texts and pages to process in this run. Items beyond the limit are listed as skipped and not charged. Example: 1000.",
            "default": 1000
          },
          "maxCharsPerText": {
            "title": "Max characters analysed per text",
            "minimum": 100,
            "maximum": 200000,
            "type": "integer",
            "description": "Longer texts are cut to this length for detection (charCount still shows the full length). 2,000 to 5,000 characters is plenty for a reliable answer. Example: 20000.",
            "default": 20000
          },
          "concurrency": {
            "title": "Parallel page downloads",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many page URLs are downloaded at the same time. Example: 4.",
            "default": 4
          },
          "timeoutSecs": {
            "title": "Page timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "number",
            "description": "Give up on a page URL after this many seconds. Example: 30.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy (optional, for page URLs)",
            "type": "object",
            "description": "Only used for page URLs. Leave empty to download pages directly."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}