Introduction

Run "what-if" scenarios against a SureSheet using the Collab API

A SureSheet is a workbook that resets every time you reload it. An example SureSheet:

The SureSheet Collab API allows you to run "what-if" scenarios against a SureSheet. For example, in the above Investment Growth SureSheet, we can calculate the "capital at end of term" (C13) if our initial investment (C6) is increased from $10,000 to $50,000 with this simple GET request:

Note that a simulation does not modify a SureSheet. This means the Simulation API is a robust way for business users to create spreadsheets that developers subsequently incorporate into websites / applications.

/api/v1/simulate/{workbook_id}

Supports either GET or POST

Parameters:

  • inputs : specify the input values in the simulation.

    • {<sheet name>: {<cell ref>: <value>}}

    • Example: {"Sheet1":{"A1": 100}}

  • outputs : specify the output cells to retrieve as part of the simulation

    • {<sheet name>: [<cell ref|range>]}

    • Example: {"Sheet1":["B1", "C2:D3"]}

The request response will contain the values requested by the outputs parameter.

Simple example

inputs={"Sheet1":{"C6":25000}}
outputs={"Sheet1":["C13"]}
response={
  "Sheet1": {
    "C13": 50783.31719489607
  }
}

https://www.equalto.com/suresheet/api/v1/simulate/abc7cbef-2491-4787-94f8-6542fab12a4e?inputs={"Sheet1":{"C6":25000}}&outputs={"Sheet1":["C13"]}

Advanced example - with ranges

inputs={"Sheet1":{"C6":25000}}
outputs={"Sheet1":["C13", "B14:C16"]}
response={
  "Sheet1": {
    "C13": 50783.31719489607,
    "B14:C16": [
      ["   Initial investment amount:", 25000.0],
      ["   Additional contributions:", 10500.0],
      ["   Interest earned:", 15283.31719489607]
    ]
  }
}

https://www.equalto.com/suresheet/api/v1/simulate/abc7cbef-2491-4787-94f8-6542fab12a4e?inputs={"Sheet1":{"C6":25000}}&outputs={"Sheet1":["C13","B14:C16"]}

Last updated