{
  "openapi": "3.0.1",
  "info": {
    "title": "Excel Model API: Recalculate Workbooks, What-If & Goal Seek",
    "description": "Run your Excel or Google Sheets model as an API: set inputs by cell, name or label, recalculate every formula and get the results as JSON. Scenarios, sweeps over one or two inputs, goal seek, and a list of a workbook's inputs and results.",
    "version": "0.1",
    "x-build-id": "NklVflQo3OdvPpX9u"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jumblemog~excel-model-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jumblemog-excel-model-api",
        "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/jumblemog~excel-model-api/runs": {
      "post": {
        "operationId": "runs-sync-jumblemog-excel-model-api",
        "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/jumblemog~excel-model-api/run-sync": {
      "post": {
        "operationId": "run-sync-jumblemog-excel-model-api",
        "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": {
          "workbook": {
            "title": "Workbook",
            "type": "string",
            "description": "A link to the .xlsx, .xlsm, .xlsb, .xls or .ods file, or a Google Sheets link (shared so anyone with the link can view); Google Drive, Dropbox and OneDrive share links work. Base64 works too. Send it alone to list its inputs and results."
          },
          "uploads": {
            "title": "Or upload the workbook",
            "type": "array",
            "description": "Upload one workbook from your computer, or pick one already in an Apify key-value store."
          },
          "inputs": {
            "title": "Inputs to change",
            "type": "object",
            "description": "Each cell to change and its new value. Name a cell by its label (the text next to it, such as \"Home price\"), a defined name, or an address (\"B3\", \"Inputs!B3\"). Values are read as typed: \"$520,000\", \"5.5%\", \"2026-12-01\", true. A list fills a range (one value per row, or rows of values)."
          },
          "outputs": {
            "title": "Outputs to read",
            "type": "array",
            "description": "Cells or ranges to read after recalculating, by label, name or address (\"Schedule!A2:E13\" for a table). Empty: the workbook's results, found from its formulas.",
            "items": {
              "type": "string"
            }
          },
          "scenarios": {
            "title": "Scenarios",
            "type": "array",
            "description": "Several sets of inputs, one calculation each, e.g. [{\"scenario\": \"low\", \"Interest rate\": \"5%\"}, {\"scenario\": \"high\", \"Interest rate\": \"7%\"}]. The inputs above apply to every scenario. Up to 1,000."
          },
          "scenariosUrl": {
            "title": "Or scenarios from a spreadsheet",
            "type": "string",
            "description": "A CSV, Excel or JSON link or a Google Sheet, or CSV text: one scenario per row, the first row naming the inputs (a column named scenario names each one)."
          },
          "sweep": {
            "title": "Sweep (what-if table)",
            "type": "array",
            "description": "Step one input through values, or two for a two-way table: [{\"input\": \"Interest rate\", \"from\": 0.04, \"to\": 0.08, \"step\": 0.005}, {\"input\": \"Term (years)\", \"values\": [15, 30]}]. Each point is one calculation."
          },
          "goalSeek": {
            "title": "Goal seek",
            "type": "array",
            "description": "Find the input value that makes a result hit a target, like Excel's Goal Seek: [{\"set\": \"Monthly payment\", \"to\": 3000, \"by\": \"Home price\"}]."
          },
          "sheet": {
            "title": "Default sheet",
            "type": "string",
            "description": "The sheet that addresses without a sheet name (\"B3\") refer to. By default the first sheet."
          },
          "returnWorkbook": {
            "title": "Return the recalculated workbook",
            "type": "boolean",
            "description": "Save a copy of the workbook with the new inputs and recalculated values for each calculation (the first 20).",
            "default": false
          },
          "requests": {
            "title": "More workbooks",
            "type": "array",
            "description": "More workbooks in one run: each entry is {\"workbook\": link or base64, \"inputs\", \"outputs\", \"scenarios\", \"sweep\", \"goalSeek\", \"sheet\", \"returnWorkbook\"}, or a link alone to list its inputs and results. Up to 20."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}