{
  "openapi": "3.0.1",
  "info": {
    "title": "Data Converter: Base64, Hash, CSV, JSON, XLSX [USD 0.2/1K]",
    "description": "Bulk Base64, hex, data URI, hash (MD5, SHA, CRC32), HMAC, URL and HTML encode and decode for texts and files, and CSV, TSV, JSON, JSONL, XLSX, XML, YAML conversion. USD 0.20 per 1,000 texts, USD 0.80 per 1,000 files (first MB included), USD 0.15 per 1,000 extra MB.",
    "version": "1.0",
    "x-build-id": "TNrcGt0oivDJsgNvo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/usefulapi~data-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-usefulapi-data-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/usefulapi~data-converter/runs": {
      "post": {
        "operationId": "runs-sync-usefulapi-data-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/usefulapi~data-converter/run-sync": {
      "post": {
        "operationId": "run-sync-usefulapi-data-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": {
          "operation": {
            "title": "Operation",
            "enum": [
              "base64-encode",
              "base64-decode",
              "base64url-encode",
              "base64url-decode",
              "hex-encode",
              "hex-decode",
              "data-uri-encode",
              "data-uri-decode",
              "hash",
              "hmac",
              "url-encode",
              "url-decode",
              "html-encode",
              "html-decode",
              "convert"
            ],
            "type": "string",
            "description": "What to do with every item. Base64, Base64URL, hex and data URI encode and decode; hash (MD5, SHA-1, SHA-256, SHA-512, SHA3-256, CRC32); hmac (needs the HMAC key); URL and HTML entity encode and decode; convert (CSV, TSV, JSON, JSONL, XLSX, XML, YAML into each other, needs Convert to). An item in the Mixed items list can set its own operation.",
            "default": "base64-encode"
          },
          "texts": {
            "title": "Texts",
            "type": "array",
            "description": "One text per entry, up to 1 MB each. Billed per text.",
            "items": {
              "type": "string"
            }
          },
          "fileUrls": {
            "title": "File addresses",
            "type": "array",
            "description": "One http or https address per line. Any file, up to the file size limit. Billed per file, first MB included. Addresses are fetched as given (a direct link to the file). A record of one of your key-value stores works too: use its record URL (with a signature, or a public store).",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "title": "Mixed items (JSON)",
            "type": "array",
            "description": "For items that need their own settings. Each entry is an object with \"text\", \"url\" or \"kvKey\", and optionally \"operation\", \"targetFormat\", \"sourceFormat\", \"algorithms\", \"name\", \"mimeType\", \"sheets\", \"recordPath\". Example: {\"url\": \"https://example.com/data.xlsx\", \"operation\": \"convert\", \"targetFormat\": \"json\"}."
          },
          "targetFormat": {
            "title": "Convert to",
            "enum": [
              "csv",
              "tsv",
              "json",
              "jsonl",
              "xlsx",
              "xml",
              "yaml"
            ],
            "type": "string",
            "description": "For the convert operation: the format to produce. XLSX is always saved as a file."
          },
          "sourceFormat": {
            "title": "Convert from",
            "enum": [
              "auto",
              "csv",
              "tsv",
              "json",
              "jsonl",
              "xlsx",
              "xml",
              "yaml"
            ],
            "type": "string",
            "description": "Auto detects the format from the file contents, then its name and content type, then the text itself.",
            "default": "auto"
          },
          "algorithms": {
            "title": "Hash algorithms",
            "type": "array",
            "description": "For the hash operation: one or more of md5, sha1, sha256, sha512, sha3-256, crc32. All of them are computed for the same price. Default: sha256.",
            "items": {
              "type": "string"
            }
          },
          "hmacKey": {
            "title": "HMAC key",
            "type": "string",
            "description": "For the hmac operation. Stored encrypted by Apify, never written to the results, the summary or the log."
          },
          "hmacAlgorithm": {
            "title": "HMAC algorithm",
            "enum": [
              "sha256",
              "sha1",
              "sha512",
              "md5",
              "sha3-256"
            ],
            "type": "string",
            "description": "Hash used for HMAC.",
            "default": "sha256"
          },
          "hmacKeyEncoding": {
            "title": "HMAC key format",
            "enum": [
              "utf8",
              "hex",
              "base64"
            ],
            "type": "string",
            "description": "How the key text is read: as plain text (utf8), as hex digits, or as Base64.",
            "default": "utf8"
          },
          "digestEncoding": {
            "title": "Hash and HMAC output",
            "enum": [
              "hex",
              "base64",
              "base64url"
            ],
            "type": "string",
            "description": "How the digest is written.",
            "default": "hex"
          },
          "urlMode": {
            "title": "URL encoding mode",
            "enum": [
              "component",
              "full",
              "form"
            ],
            "type": "string",
            "description": "component = encodeURIComponent (every reserved character), full = encodeURI (keeps : / ? # & =), form = application/x-www-form-urlencoded (space as +).",
            "default": "component"
          },
          "htmlMode": {
            "title": "HTML encoding mode",
            "enum": [
              "minimal",
              "named",
              "numeric"
            ],
            "type": "string",
            "description": "minimal = only & < > \" ' ; named = named entities for non-ASCII letters (&eacute;); numeric = numeric references (&#233;).",
            "default": "minimal"
          },
          "mimeType": {
            "title": "Data URI mime type",
            "type": "string",
            "description": "For data-uri-encode: the mime type to put in the URI (for example image/png). Empty = detected from the content."
          },
          "base64LineLength": {
            "title": "Base64 line length",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Break Base64 output into lines of this length (76 for MIME). 0 = one line.",
            "default": 0
          },
          "base64UrlPadding": {
            "title": "Base64URL padding",
            "type": "boolean",
            "description": "Keep = padding in Base64URL output (RFC 4648 section 5). Default: no padding.",
            "default": false
          },
          "hexUppercase": {
            "title": "Uppercase hex",
            "type": "boolean",
            "description": "Write hex digits as A-F instead of a-f.",
            "default": false
          },
          "hasHeader": {
            "title": "First row is a header",
            "type": "boolean",
            "description": "Tables (CSV, TSV, XLSX): the first row holds the column names.",
            "default": true
          },
          "inferTypes": {
            "title": "Turn numbers and true/false into JSON values",
            "type": "boolean",
            "description": "For JSON, JSONL, YAML and XLSX results. When on, plain numbers and true/false from CSV, TSV and XML become numbers and booleans, but only when the number is exactly the value written (007, 1e5, 12.5% and IDs over 2^53 stay text). CSV, TSV and XML results always keep values as written. Off keeps every value as text.",
            "default": true
          },
          "sheets": {
            "title": "XLSX sheets",
            "type": "string",
            "description": "first = the first sheet, all = every sheet (JSON gets one key per sheet, CSV one file per sheet), or a sheet name or number.",
            "default": "first"
          },
          "xlsxFormulas": {
            "title": "XLSX formulas",
            "enum": [
              "values",
              "formulas"
            ],
            "type": "string",
            "description": "values = the last calculated value of each cell, formulas = the formula text (=SUM(A1:A3)).",
            "default": "values"
          },
          "recordPath": {
            "title": "Record path (JSON, YAML, XML to a table)",
            "type": "string",
            "description": "Where the list of records is, for example results or feed.entry. Empty = found automatically."
          },
          "flatten": {
            "title": "Nested values in tables",
            "enum": [
              "dot",
              "json"
            ],
            "type": "string",
            "description": "dot = nested objects become columns like address.city (lists stay JSON text); json = each nested value is one JSON text cell.",
            "default": "dot"
          },
          "csvDelimiter": {
            "title": "CSV delimiter (reading)",
            "type": "string",
            "description": "auto, comma, semicolon, tab, pipe, or one character.",
            "default": "auto"
          },
          "csvOutputDelimiter": {
            "title": "CSV delimiter (writing)",
            "type": "string",
            "description": "For CSV output: comma (default), semicolon, tab or pipe. TSV output always uses tab.",
            "default": ","
          },
          "csvFormulaGuard": {
            "title": "CSV formula guard",
            "type": "boolean",
            "description": "Put a single quote in front of text cells that start with = + - @ so spreadsheet programs do not run them as formulas (CSV injection). Cells that are only a number (-3, +1.5) are not touched.",
            "default": false
          },
          "csvBom": {
            "title": "CSV byte order mark",
            "type": "boolean",
            "description": "Start CSV files with a UTF-8 byte order mark, which makes Excel read accents correctly.",
            "default": false
          },
          "csvLineEnding": {
            "title": "CSV line endings",
            "enum": [
              "crlf",
              "lf"
            ],
            "type": "string",
            "description": "crlf (RFC 4180) or lf.",
            "default": "crlf"
          },
          "jsonIndent": {
            "title": "JSON and XML indent",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Spaces per level in JSON and XML output. 0 = compact.",
            "default": 2
          },
          "xmlRoot": {
            "title": "XML root element",
            "type": "string",
            "description": "Name of the outer element when the data has no single root. Default: root (rows for tables)."
          },
          "xmlItem": {
            "title": "XML list item element",
            "type": "string",
            "description": "Name of each element of a list. Default: item (row for tables)."
          },
          "encoding": {
            "title": "Text encoding of files",
            "type": "string",
            "description": "auto reads a byte order mark, an XML declaration, then UTF-8, then Windows-1252. Or name one: utf-8, utf-16le, windows-1252, iso-8859-1.",
            "default": "auto"
          },
          "maxFileMb": {
            "title": "Largest file (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Files above this size are refused (status too_large). The result may not pass it either, so Base64 encoding takes files up to 3/4 of it and hex up to half. Conversions hold the whole table in memory and stop at 20 MB.",
            "default": 25
          },
          "maxInputs": {
            "title": "Maximum items",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many items. Leave empty for all."
          },
          "inlineMaxKb": {
            "title": "Return small text results in the row (KB)",
            "minimum": 0,
            "maximum": 4096,
            "type": "integer",
            "description": "A text result of a file (Base64, hex, converted JSON or CSV) up to this size is put in the row's \"result\" field and no file is saved. Larger results, binary results and XLSX are saved as files with a link. 0 = always save a file.",
            "default": 256
          },
          "alwaysSaveFile": {
            "title": "Always save a file",
            "type": "boolean",
            "description": "Also save small text results as files.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}