{
  "openapi": "3.0.1",
  "info": {
    "title": "Text to CSV Converter: Turn Text, Tables & Logs into CSV",
    "description": "Text to CSV converter: turn pasted text, text file URLs or a dataset field into CSV, Excel (XLSX) and JSON rows. Detects comma, tab, pipe, space and fixed-width columns, and parses regex matches, key-value blocks, Markdown, ASCII and HTML tables, and Apache, nginx and syslog logs.",
    "version": "0.1",
    "x-build-id": "N2c2VEtTemt4WUh8K"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~text-to-csv-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-text-to-csv-converter",
        "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~text-to-csv-converter/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-text-to-csv-converter",
        "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~text-to-csv-converter/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-text-to-csv-converter",
        "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": {
          "text": {
            "title": "Text to convert",
            "type": "string",
            "description": "Paste the text here: a table, a list, a log, key: value blocks, or any delimited data. Example: lines like name|city|amount. The format is detected automatically unless you pick a Mode. You can paste up to about 50 MB (see Max text size)."
          },
          "fileUrls": {
            "title": "Text file URLs",
            "type": "array",
            "description": "Direct links to text files to convert: .txt, .log, .csv, .tsv, .md or .html. Example: https://example.com/exports/report.txt. GitHub file pages are turned into raw links. Up to 500 per run; private network addresses are blocked and a link that cannot be read is skipped for free.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset with text",
            "type": "string",
            "description": "Optional. An Apify dataset whose items hold text in one field (for example the output of a scraper or a web crawler). Every item becomes its own table. Pick it from the list or paste a dataset ID such as aBcD1234eFgH5678i."
          },
          "datasetField": {
            "title": "Field with the text",
            "type": "string",
            "description": "Name of the dataset field that holds the text. Dots reach nested fields. Example: text or response.body. Required when a dataset is set."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "auto",
              "delimited",
              "lines",
              "regex",
              "keyvalue",
              "table",
              "log"
            ],
            "type": "string",
            "description": "How to turn the text into columns. Auto-detect checks for HTML and text tables, then logs, then key: value blocks, then delimited columns. Pick one yourself if the guess is wrong. The mode that was used is reported in the SUMMARY record.",
            "default": "auto"
          },
          "delimiter": {
            "title": "Delimiter (delimited mode)",
            "enum": [
              "auto",
              "comma",
              "tab",
              "semicolon",
              "pipe",
              "spaces",
              "fixed",
              "custom"
            ],
            "type": "string",
            "description": "Column separator for delimited text. Auto-detect tries comma, tab, semicolon and pipe, then runs of spaces, then fixed-width columns found by their aligned gaps. Example: choose Pipe for id|name|city.",
            "default": "auto"
          },
          "customDelimiter": {
            "title": "Custom delimiter",
            "type": "string",
            "description": "Your own separator, used when Delimiter is Custom. Example: :: or ~ or \\t for a tab. Can be several characters; quotes are not recognized for separators longer than one character."
          },
          "quoteHandling": {
            "title": "Quote handling",
            "enum": [
              "auto",
              "double",
              "single",
              "none"
            ],
            "type": "string",
            "description": "Which quote character protects a delimiter inside a value, as in \"Smith, John\". Choose No quotes when the text has stray quote marks that confuse the columns.",
            "default": "auto"
          },
          "regexPattern": {
            "title": "Regex pattern",
            "type": "string",
            "description": "Python regular expression for Regex mode. Each named group becomes a column. Example: (?P<ip>\\d+\\.\\d+\\.\\d+\\.\\d+) (?P<status>\\d{3}). Unnamed groups become group_1, group_2. With no groups the whole match becomes a column named match. Setting a pattern while Mode is Auto-detect switches to Regex mode."
          },
          "regexScope": {
            "title": "Regex scope",
            "enum": [
              "perLine",
              "findall"
            ],
            "type": "string",
            "description": "Per line gives at most one row per line and skips lines without a match. Find all returns every match across the text, even several on one line or matches that span lines.",
            "default": "perLine"
          },
          "regexIgnoreCase": {
            "title": "Regex ignore case",
            "type": "boolean",
            "description": "Match upper and lower case letters alike in the pattern. Example: INFO also matches info.",
            "default": false
          },
          "lineSeparator": {
            "title": "Line separator (lines mode)",
            "type": "string",
            "description": "Lines mode only. When set, each line is split on this text into columns. Example: ' - ' or '=>'. Leave empty to get one row per line in a column named line."
          },
          "linesLayout": {
            "title": "Lines layout (lines mode)",
            "enum": [
              "rows",
              "columns"
            ],
            "type": "string",
            "description": "Lines mode without a separator. One row per line gives a column named line. One column per line gives a single row with columns line_1, line_2, and so on (up to 16384).",
            "default": "rows"
          },
          "logFormat": {
            "title": "Log format (log mode)",
            "enum": [
              "auto",
              "apache",
              "nginx",
              "syslog",
              "timestamped"
            ],
            "type": "string",
            "description": "Log mode only. Auto-detect picks the format that matches most lines. Lines that do not match are skipped and counted in the warnings. For any other log layout use Regex mode with named groups.",
            "default": "auto"
          },
          "keyValueSeparator": {
            "title": "Key-value separator",
            "enum": [
              "auto",
              "colon",
              "equals"
            ],
            "type": "string",
            "description": "Key-value mode only. Records are separated by blank lines, or start again when a key repeats. Indented lines continue the previous value. Example: name: Ada then city: London.",
            "default": "auto"
          },
          "tableNumber": {
            "title": "Table number",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Table mode only. Which table to convert when the text or HTML holds several (1 is the first). Example: 2 for the second table.",
            "default": 1
          },
          "headerRow": {
            "title": "Header row",
            "enum": [
              "auto",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Whether the first row is the header. Auto-detect treats it as a header when every cell is a unique, non-numeric label. Modes with built-in names (regex, key-value, log) ignore this.",
            "default": "auto"
          },
          "skipLines": {
            "title": "Skip first lines",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Number of lines to ignore at the start, such as a title or a note above the table. Example: 2.",
            "default": 0
          },
          "trim": {
            "title": "Trim whitespace",
            "type": "boolean",
            "description": "Remove leading and trailing spaces from values and column names. Cells that end up empty become null.",
            "default": true
          },
          "skipBlankLines": {
            "title": "Skip blank lines",
            "type": "boolean",
            "description": "Leave out blank lines and rows where every cell is empty.",
            "default": true
          },
          "inferTypes": {
            "title": "Detect numbers and booleans",
            "type": "boolean",
            "description": "Turn a column into numbers or true/false when every value in it fits. Values with leading zeros (007), a plus sign or more than 15 digits stay text. Mixed columns stay text. Also the master switch for date detection.",
            "default": true
          },
          "inferBooleans": {
            "title": "Detect true/false",
            "type": "boolean",
            "description": "Only the words true and false (any case) count as booleans. Used when Detect numbers and booleans is on.",
            "default": true
          },
          "inferDates": {
            "title": "Detect dates",
            "type": "boolean",
            "description": "Normalize a column to ISO 8601 (2024-01-15 or 2024-01-15T10:30:00) when every value is a clear date such as 2024-01-15, 15 Jan 2024 or Jan 15, 2024. Numeric dates like 03/04/2024 are converted only when the column shows which part is the day. Used when Detect numbers and booleans is on.",
            "default": true
          },
          "maxRows": {
            "title": "Max rows per table",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Stop after this many data rows per source. This caps both the dataset rows and the cost. Example: 5000.",
            "default": 100000
          },
          "encoding": {
            "title": "Text encoding",
            "enum": [
              "auto",
              "utf-8",
              "utf-16",
              "cp1252",
              "latin-1"
            ],
            "type": "string",
            "description": "Auto-detect reads a byte order mark, then tries UTF-8 and falls back to Windows-1252. Pick one only if accents come out wrong in a file from a link. Pasted text needs no setting.",
            "default": "auto"
          },
          "includeSource": {
            "title": "Add _source column",
            "type": "boolean",
            "description": "Add the source name (pasted-text, the file name, or the dataset item) as the first column of every dataset row. Always on when there is more than one source. It is not added to the output files.",
            "default": false
          },
          "maxFileSizeMb": {
            "title": "Max text size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Sources larger than this are skipped for free. Units: megabytes per source. Example: 50.",
            "default": 50
          },
          "outputFormats": {
            "title": "Output files",
            "type": "array",
            "description": "Files to save in the key-value store, each with a download link in the SUMMARY record. Every file is one file-exported charge. Leave the list empty for dataset rows only. Example: csv and xlsx.",
            "items": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx",
                "json"
              ],
              "enumTitles": [
                "CSV",
                "Excel (.xlsx)",
                "JSON"
              ]
            },
            "default": [
              "csv"
            ]
          },
          "outputEncoding": {
            "title": "CSV encoding",
            "enum": [
              "utf-8-sig",
              "utf-8",
              "cp1252"
            ],
            "type": "string",
            "description": "Character encoding of the CSV file. UTF-8 with BOM makes Excel show accents and symbols correctly. Windows-1252 replaces characters it cannot hold with a question mark.",
            "default": "utf-8-sig"
          },
          "outputDelimiter": {
            "title": "CSV delimiter",
            "enum": [
              "comma",
              "semicolon",
              "tab",
              "pipe"
            ],
            "type": "string",
            "description": "Separator written in the CSV file. Example: semicolon when your Excel expects it.",
            "default": "comma"
          },
          "quoteAllFields": {
            "title": "Quote every CSV field",
            "type": "boolean",
            "description": "Put every CSV value in double quotes. Off quotes only values that need it (those with the delimiter, a quote or a line break).",
            "default": false
          },
          "escapeFormulas": {
            "title": "Protect against formulas",
            "type": "boolean",
            "description": "In the CSV file, prefix text that starts with = + - or @ with an apostrophe so Excel cannot run it as a formula. Numbers such as -5 are not changed.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}