{
  "openapi": "3.0.1",
  "info": {
    "title": "Base64 Encoder & Decoder: Text, Files, Data URI",
    "description": "Encode or decode Base64 in bulk from texts, file URLs or a dataset column. Standard and URL-safe, data URI creation and parsing with MIME detection. Decoded binary is saved to storage with a link. Failed items are free. Empty input = free demo.",
    "version": "0.1",
    "x-build-id": "i89EPiktDoFr6RKRE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ucchiii~base64-encoder-decoder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ucchiii-base64-encoder-decoder",
        "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/ucchiii~base64-encoder-decoder/runs": {
      "post": {
        "operationId": "runs-sync-ucchiii-base64-encoder-decoder",
        "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/ucchiii~base64-encoder-decoder/run-sync": {
      "post": {
        "operationId": "run-sync-ucchiii-base64-encoder-decoder",
        "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": [
              "encode",
              "decode"
            ],
            "type": "string",
            "description": "Encode turns text or a file into Base64 (or a data URI). Decode turns Base64 or a data URI back into text, or into a stored file when the content is binary. Default: encode.",
            "default": "encode"
          },
          "texts": {
            "title": "Texts",
            "type": "array",
            "description": "The texts to convert, one per line. When decoding, each line is Base64 or a full data URI. Clear this list, the file URLs and the datasets to run the free demo.",
            "items": {
              "type": "string"
            }
          },
          "fileUrls": {
            "title": "File URLs",
            "type": "array",
            "description": "Public http(s) links to files (up to 500 per run). Encode: the file itself is encoded, so images, PDFs and fonts work. Decode: the file must be text that contains Base64 or a data URI. Links to internal networks are blocked.",
            "items": {
              "type": "string"
            }
          },
          "datasetIds": {
            "title": "Apify datasets",
            "type": "array",
            "description": "Datasets whose columns you want to convert (the 'defaultDatasetId' of a finished run). You can paste a dataset URL from Apify Console too. Needs 'Dataset columns to convert'. The source dataset is never changed."
          },
          "datasetFields": {
            "title": "Dataset columns to convert",
            "type": "array",
            "description": "Dataset only. Names of the columns to convert, such as 'title' or 'image.base64'. Dot paths reach into nested objects. Each value becomes one output row (and one charged conversion); empty values are skipped.",
            "items": {
              "type": "string"
            }
          },
          "keepFields": {
            "title": "Dataset columns to copy",
            "type": "array",
            "description": "Dataset only. Columns copied unchanged onto every output row so you can match results back to the source, for example 'id' or 'url'. Dot paths work.",
            "items": {
              "type": "string"
            }
          },
          "valuesAreUrls": {
            "title": "Dataset values are file URLs",
            "type": "boolean",
            "description": "Dataset only. Treat each value in the chosen columns as a file URL to download and convert, instead of as text. Subject to the same size limit and pause per host.",
            "default": false
          },
          "alphabet": {
            "title": "Encode: alphabet",
            "enum": [
              "standard",
              "urlsafe"
            ],
            "type": "string",
            "description": "Encode only. URL-safe replaces + and / with - and _ so the result can sit in a URL or file name. Decoding always accepts both. Default: standard.",
            "default": "standard"
          },
          "padding": {
            "title": "Encode: keep = padding",
            "type": "boolean",
            "description": "Encode only. Keep the trailing = characters. Turn off for the short form used in JWTs and URLs. Decoding works with or without padding. Default: on.",
            "default": true
          },
          "lineWrap": {
            "title": "Encode: line length",
            "enum": [
              "0",
              "64",
              "76"
            ],
            "type": "string",
            "description": "Encode only, plain Base64 (not data URIs). Insert a line break after this many characters. Default: none.",
            "default": "0"
          },
          "makeDataUri": {
            "title": "Encode: make a data URI",
            "type": "boolean",
            "description": "Encode only. Return 'data:<type>;base64,...' instead of bare Base64. The MIME type comes from the server, the file content or the file extension; texts get text/plain. The type is also in the 'mime' column.",
            "default": false
          },
          "textEncoding": {
            "title": "Text character set",
            "enum": [
              "utf-8",
              "shift_jis",
              "euc-jp",
              "iso-8859-1",
              "utf-16"
            ],
            "type": "string",
            "description": "How text is turned into bytes when encoding, and bytes into text when decoding (a charset named inside a data URI wins). Files are always encoded byte for byte. Default: UTF-8.",
            "default": "utf-8"
          },
          "decodeAs": {
            "title": "Decode: result type",
            "enum": [
              "auto",
              "text",
              "file"
            ],
            "type": "string",
            "description": "Decode only. Automatic returns text when the bytes are readable text and saves everything else (images, PDFs, archives) to the key-value store with a download link. Default: automatic.",
            "default": "auto"
          },
          "maxInlineKb": {
            "title": "Longest result in the table (KB)",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "A result longer than this is not put in the table cell but saved as a text file in the key-value store (see 'fileUrl'). Keeps the dataset small. Default: 256.",
            "default": 256
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many items (texts, files and dataset values together). Caps run time and cost ($1 per 1,000 conversions). When it stops early, 'truncated' is true in the run summary. Default: 1,000.",
            "default": 1000
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 0.01,
            "maximum": 50,
            "type": "number",
            "description": "Largest file that is downloaded. Bigger files are skipped with an error and are free. One run downloads at most 200 MB in total. Default: 10.",
            "default": 10
          },
          "timeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "How long to wait for a server before giving up on one attempt. Default: 30.",
            "default": 30
          },
          "retries": {
            "title": "Download retries",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Extra attempts when a server times out or answers 429 or 5xx, with a growing pause. Other errors (404, 403) are not retried. Default: 2.",
            "default": 2
          },
          "delayPerHostSecs": {
            "title": "Pause per host (seconds)",
            "minimum": 0.1,
            "maximum": 30,
            "type": "number",
            "description": "Minimum pause between two downloads from the same host. Files are fetched one at a time. Default: 0.5.",
            "default": 0.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}