{
  "openapi": "3.0.1",
  "info": {
    "title": "Data Format and Unit Converter",
    "description": "Offline conversion between CSV, JSON, JSON Lines, YAML, XML and TOML, plus exact unit conversion for length, mass, temperature, pressure, energy, force, power and volume. No network access and no scraping.",
    "version": "0.1",
    "x-build-id": "pUPfxBgsbsa5P4nbU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brightwater-tools~data-format-unit-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brightwater-tools-data-format-unit-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/brightwater-tools~data-format-unit-converter/runs": {
      "post": {
        "operationId": "runs-sync-brightwater-tools-data-format-unit-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/brightwater-tools~data-format-unit-converter/run-sync": {
      "post": {
        "operationId": "run-sync-brightwater-tools-data-format-unit-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "convert",
              "units"
            ],
            "type": "string",
            "description": "'convert' changes the text in 'data' from one data format to another. 'units' converts each number in 'values' from one unit to another.",
            "default": "convert"
          },
          "data": {
            "title": "Data to convert",
            "type": "string",
            "description": "Text to convert (convert mode only). Paste the whole document here. Nothing is fetched from a URL or read from a file. The size limit is max_input_bytes.",
            "default": "[{\"material\": \"steel\", \"density_kg_m3\": 7850}, {\"material\": \"aluminium\", \"density_kg_m3\": 2700}]"
          },
          "input_format": {
            "title": "Input format",
            "enum": [
              "csv",
              "json",
              "jsonl",
              "yaml",
              "xml",
              "toml"
            ],
            "type": "string",
            "description": "Format of the text in 'data'. CSV must have a header row. JSON Lines holds one JSON value per line. XML with DOCTYPE or ENTITY declarations is refused.",
            "default": "json"
          },
          "output_format": {
            "title": "Output format",
            "enum": [
              "csv",
              "json",
              "jsonl",
              "yaml",
              "xml",
              "toml"
            ],
            "type": "string",
            "description": "Format to write. TOML needs an object at the top level. Nested data is flattened into dotted column names when written to CSV.",
            "default": "csv"
          },
          "csv_delimiter": {
            "title": "CSV delimiter",
            "minLength": 1,
            "maxLength": 1,
            "type": "string",
            "description": "One character that separates CSV fields, for example ',' or ';' or a tab.",
            "default": ","
          },
          "xml_root": {
            "title": "XML root element name",
            "type": "string",
            "description": "Name of the outer element when writing XML. Use letters, digits, '_', '-' or '.', and do not start with a digit.",
            "default": "root"
          },
          "pretty": {
            "title": "Pretty output",
            "type": "boolean",
            "description": "Indent JSON, YAML and XML output so it is easy to read. Turn off for the smallest output.",
            "default": true
          },
          "max_input_bytes": {
            "title": "Maximum input size (bytes)",
            "minimum": 1,
            "maximum": 5000000,
            "type": "integer",
            "description": "Inputs larger than this are refused with an error. The hard ceiling is 5,000,000 bytes.",
            "default": 1000000
          },
          "units_category": {
            "title": "Unit category",
            "enum": [
              "length",
              "mass",
              "temperature",
              "pressure",
              "energy",
              "force",
              "power",
              "volume"
            ],
            "type": "string",
            "description": "Kind of quantity to convert. Used in 'units' mode only.",
            "default": "length"
          },
          "units_from": {
            "title": "Convert from unit",
            "type": "string",
            "description": "Source unit name, in lower case with underscores, for example 'inch', 'pound_force' or 'fahrenheit'. Used in 'units' mode only.",
            "default": "inch"
          },
          "units_to": {
            "title": "Convert to unit",
            "type": "string",
            "description": "Target unit name, in lower case with underscores, for example 'centimeter' or 'celsius'. Used in 'units' mode only.",
            "default": "centimeter"
          },
          "values": {
            "title": "Values to convert",
            "type": "string",
            "description": "One number per line, in plain decimal notation such as 12.5 or -40. Up to 1,000 lines. Used in 'units' mode only.",
            "default": "1\n2.5\n12"
          },
          "precision": {
            "title": "Significant digits",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many significant digits to keep in each result. The arithmetic is exact; only the final output is rounded.",
            "default": 12
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}