{
  "openapi": "3.0.1",
  "info": {
    "title": "Encoding Toolkit: Base64, Hash, URL Encode, JSON to CSV",
    "description": "Base64 and hex encode or decode texts and files, URL and HTML encode, MD5, SHA and HMAC hashes, CRC32, UUIDs, JSON pretty, minify and validate, JSON to CSV, CSV to JSON, JWT decode, slugs and text stats. Up to 10,000 items per run, one row each. For automations and AI agents.",
    "version": "0.1",
    "x-build-id": "KrCipJdBPph6mKWU7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forgeloop~encoding-toolkit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forgeloop-encoding-toolkit",
        "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/forgeloop~encoding-toolkit/runs": {
      "post": {
        "operationId": "runs-sync-forgeloop-encoding-toolkit",
        "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/forgeloop~encoding-toolkit/run-sync": {
      "post": {
        "operationId": "run-sync-forgeloop-encoding-toolkit",
        "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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "base64Encode",
              "base64Decode",
              "base64UrlEncode",
              "base64UrlDecode",
              "hexEncode",
              "hexDecode",
              "urlEncode",
              "urlDecode",
              "htmlEncode",
              "htmlDecode",
              "md5",
              "sha1",
              "sha256",
              "sha512",
              "hmac",
              "crc32",
              "uuid",
              "jsonPretty",
              "jsonMinify",
              "jsonValidate",
              "jsonToCsv",
              "csvToJson",
              "jwtDecode",
              "slugify",
              "textStats"
            ],
            "type": "string",
            "description": "What to do with every item. Hashes, Base64 and hex work on texts and files. URL, HTML, JWT and slug operations work on text only. UUID v4 ignores the items and generates the number of UUIDs set below.",
            "default": "base64Encode"
          },
          "items": {
            "title": "Items",
            "type": "array",
            "description": "One entry per item: a text, or a direct http(s) link to a file (for Base64, hex, hashes, CRC32, JSON, CSV and text stats). Empty entries are skipped. Over the API you can also pass objects like {\"text\": \"...\"} or {\"url\": \"https://...\"} to be explicit. Use the Text field below for one multi-line text such as a CSV or a JSON document.",
            "items": {
              "type": "string"
            }
          },
          "text": {
            "title": "Text (one multi-line item)",
            "type": "string",
            "description": "Optional. One text item that can span many lines, for example a CSV table, a JSON document or a long text. It is processed as the first item, before the Items list."
          },
          "inputType": {
            "title": "Input type",
            "enum": [
              "auto",
              "text",
              "url"
            ],
            "type": "string",
            "description": "Auto downloads an item that is a single http(s) URL as a file for operations that accept files, and treats everything else as text. Text never downloads, so a URL is encoded or hashed as the string itself. File URL treats every item as a link to a file.",
            "default": "auto"
          },
          "uuidCount": {
            "title": "Number of UUIDs",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Only for UUID v4: how many random UUIDs to generate, one row each.",
            "default": 5
          },
          "secretKey": {
            "title": "Secret key (HMAC)",
            "type": "string",
            "description": "Only for HMAC: the shared secret. Stored encrypted and never written to the output or the log."
          },
          "secretKeyEncoding": {
            "title": "Secret key encoding",
            "enum": [
              "utf8",
              "hex",
              "base64"
            ],
            "type": "string",
            "description": "How the secret key is written. Most webhook secrets are plain text (UTF-8).",
            "default": "utf8"
          },
          "hmacAlgorithm": {
            "title": "HMAC algorithm",
            "enum": [
              "sha256",
              "sha1",
              "sha512",
              "md5"
            ],
            "type": "string",
            "description": "Hash function for HMAC.",
            "default": "sha256"
          },
          "hashEncoding": {
            "title": "Hash output",
            "enum": [
              "hex",
              "base64"
            ],
            "type": "string",
            "description": "For MD5, SHA and HMAC: lowercase hex or base64.",
            "default": "hex"
          },
          "dataUri": {
            "title": "Base64 as data URI",
            "type": "boolean",
            "description": "For Base64 encode: return data:<content type>;base64,... ready to paste into HTML, CSS or an LLM image payload. The content type comes from the server or the file bytes.",
            "default": false
          },
          "decodeOutput": {
            "title": "Decoded output",
            "enum": [
              "auto",
              "text",
              "file"
            ],
            "type": "string",
            "description": "For Base64, Base64url and hex decode. Auto returns clean UTF-8 text in the row and stores everything else (images, PDFs, ZIPs) as a file in the key-value store with a download URL. Text always returns text. File always stores a file.",
            "default": "auto"
          },
          "urlEncodeMode": {
            "title": "URL encode mode",
            "enum": [
              "component",
              "uri",
              "form"
            ],
            "type": "string",
            "description": "Component encodes every reserved character (for query values). Full URI keeps : / ? & = # intact. Form encodes spaces as + (application/x-www-form-urlencoded) and decodes + as a space.",
            "default": "component"
          },
          "htmlEncodeMode": {
            "title": "HTML encode mode",
            "enum": [
              "basic",
              "nonAscii"
            ],
            "type": "string",
            "description": "Basic escapes & < > \" and '. Non-ASCII also turns every character above ASCII into a numeric entity.",
            "default": "basic"
          },
          "jsonIndent": {
            "title": "JSON indent",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "For JSON pretty print: spaces per level.",
            "default": 2
          },
          "delimiter": {
            "title": "CSV delimiter",
            "enum": [
              "auto",
              "comma",
              "semicolon",
              "tab",
              "pipe"
            ],
            "type": "string",
            "description": "For CSV to JSON and JSON to CSV. Auto detects the delimiter of a CSV from its first line and writes commas for JSON to CSV.",
            "default": "auto"
          },
          "csvHeader": {
            "title": "CSV has a header row",
            "type": "boolean",
            "description": "For CSV to JSON: use the first row as field names. Off names the fields column1, column2 and so on.",
            "default": true
          },
          "csvParseValues": {
            "title": "Convert CSV numbers and booleans",
            "type": "boolean",
            "description": "For CSV to JSON: turn 42, 3.5, true and false into JSON numbers and booleans and empty cells into null. Off keeps every value as a string, which is safe for IDs and zip codes with leading zeros.",
            "default": false
          },
          "flattenNested": {
            "title": "Flatten nested JSON",
            "type": "boolean",
            "description": "For JSON to CSV: nested objects become columns like address.city. Off writes nested objects as JSON text in one cell. Arrays are always written as JSON text.",
            "default": true
          },
          "slugMaxLength": {
            "title": "Max slug length",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "For Slugify: cut slugs at this many characters, at a word boundary. 0 means no limit.",
            "default": 0
          },
          "includeInput": {
            "title": "Include input summary",
            "type": "boolean",
            "description": "Add the first 200 characters of each text (or the file URL) to its row. JWTs are always masked and signed URL parameters are hidden. Turn off when the inputs are confidential.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}