Turn an Excel spreadsheet into a REST API
Expose the calculations in an Excel workbook as a documented REST API, with one POST endpoint per calculation, in Rust, Java, Kotlin, C# or Go, plus typed clients and an OpenAPI spec.
A common request: "Can the website, the CRM and the mobile app all use the calculation in this spreadsheet?" Emailing the file around doesn't scale, and hosting Excel behind a server is fragile and hard to license. What you want is an API.
What Codcel generates
From one workbook, Codcel generates a REST server where each calculation becomes a POST endpoint that takes JSON in and returns JSON out:
POST /monthly_payment
Content-Type: application/json
{
"interest_rate": 5.5,
"loan_amount": 250000,
"term_years": 30
}{
"monthly_payment": 1419.47
}You choose the server language:
| Server | Framework | Default port |
|---|---|---|
| Rust | Axum | 3030 |
| Java | Javalin 6 | 7000 |
| Kotlin | Javalin 6 | 7000 |
| C# | ASP.NET Core | 5000 |
| Go | Gorilla Mux | 8080 |
The Rust server is the recommended option for production: it has the smallest footprint and the best performance.
Around the server
- OpenAPI 3.0.3 spec. An
open-api.jsondescribing every endpoint and schema, ready for Swagger UI, Postman or your API gateway. - Typed web clients. Generated clients in TypeScript, JavaScript, Python, Java, Kotlin, C#, Go, Rust and Swift that handle the HTTP and JSON for you.
- CORS. Enabled, so browser apps can call the API directly.
- Localised formatting. Send an
Accept-Languageheader to get numbers and currency formatted for that locale. - A full web UI, if you want one: a generated React front end connected to your API.
- A command-line tool for scripting and batch jobs.
Steps
- Mark inputs and outputs in the workbook with
*I*and*O*annotations, or let Codcel suggest them. - Generate a server target (and a client, if you need one) in Codcel Desktop.
- Run the generated tests to confirm the code matches the workbook.
- Start the server, for example with
cargo runfor Rust, and call it. - Deploy it like any other service: it's ordinary source code, with no Codcel runtime service involved.
Watch it
Turn Excel into a full REST API (in minutes) walks through the whole flow.
Next: the REST server reference, or download Codcel to try it.
Keep reading
Excel vs code for business calculations: when to move, and how
Spreadsheets are a great place to build a model and a risky place to run one. A practical comparison of keeping logic in Excel, rewriting it by hand, and generating code from the workbook.
Turn an Excel model into tools an AI assistant can call (MCP)
Generate a Model Context Protocol server from an Excel workbook, so Claude and other AI assistants call your real calculation instead of guessing at the maths.