SpreadAPI Documentation
Everything you need to integrate Excel calculations into your applications. RESTful API, MCP support, and comprehensive examples.
Overview
SpreadAPI turns your Excel spreadsheets into secure REST APIs. Upload your Excel file, and instantly get an API endpoint that executes your formulas and returns results. Perfect for AI integration, web apps, and automation.
Key Features
- Transform Excel files into REST APIs instantly
- AI integration with MCP protocol for Claude and ChatGPT
- Your formulas stay private and secure
- Identical inputs are answered from a stored result
- Supports complex Excel features (except VBA)
Quick Start
Get your Excel spreadsheet running as an API in 3 simple steps.
Step 1: Sign Up
Create your account at spreadapi.io. Start on the free Basic plan: one published service that stays online, unlimited drafts and 1,000 API calls a month.
Step 2: Upload Your Excel
Create a new service and upload your .xlsx file via the dashboard. You can either upload an existing Excel file or create a new one directly in the SpreadAPI app.
Step 3: Select Input and Output Cells
Manually select which cells or areas should be inputs and outputs for your API. This gives you precise control over what data your API accepts and returns.
Step 4: Publish Your Service
After selecting your inputs and outputs, click "Publish Service" to make your API endpoint live and ready to use.
Step 5: Call Your API
// JavaScript example
const response = await fetch('https://spreadapi.io/api/v1/services/my-calculator/execute', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN', // only for a token-protected service
'Content-Type': 'application/json'
},
body: JSON.stringify({
inputs: {
quantity: 100,
price: 50
}
})
});
const result = await response.json();
console.log(result.outputs); // Your Excel calculation resultsStep 6: Use with AI (Optional)
Once your service is published, you can also use it with AI assistants through the MCP server integration. This allows Claude and other AI tools to execute your Excel calculations. See the MCP Protocol section for setup instructions.
Authentication
A published service is either public or token-protected. A public service needs no authentication. A service with at least one token is protected: every call must carry a valid token of that service.
Creating a Token
- Open the published service and go to API → Access
- Click Create Token and give it a name; an expiry date is optional
- Copy the token and store it safely — it is shown only once
Tokens belong to one service. Creating the first token protects the service at once; revoking the last one makes it public again. Details: Tokens and access.
Using a Token
Send the token in the Authorization header, or as ?token= on a GET request:
Authorization: Bearer YOUR_TOKEN
Security Tips:
- Never expose tokens in client-side code
- Use environment variables for storing tokens
- Give each calling system its own token, so you can revoke one without touching the others
- Set an expiry date where access should end by itself
How It Works
SpreadAPI uses an Excel-compatible calculation engine to execute your spreadsheet formulas server-side. Your Excel logic stays intact and works exactly as designed.
The Process
- Upload: You upload your Excel file (.xlsx, .xls)
- Configure: You manually select which cells are inputs and outputs
- Publish: You publish the service to make it available
- API Creation: A unique endpoint is created for your spreadsheet
- Execution: When called, the engine runs your formulas
- Results: Calculated values are returned as JSON
Example Flow
1. Upload: pricing-calculator.xlsx
2. Inputs detected: B2 (quantity), B3 (discount)
3. Outputs detected: E10 (total), E11 (unit_price)
4. You select B2 and B3 as inputs, E10 and E11 as outputs
5. Publish the service
6. API endpoint: /services/pricing-calculator/execute
7. Call with inputs → Get calculated outputs
Services
Each Excel file you upload becomes a "service" - a standalone API endpoint that executes your spreadsheet calculations.
Service Properties
- Name: Unique identifier for your service (e.g., "pricing-calculator")
- Endpoint: REST API endpoint for executing calculations
- Inputs: Cell references that accept input values
- Outputs: Cell references that return calculated results
Managing Services
You can manage your services through the dashboard:
- View all services and their usage
- Update Excel files
- Configure input/output mappings
- Set permissions for AI access
- Monitor API calls and performance
Permissions
Control exactly what AI assistants and applications can do with your Excel data.
Permission Types
Read Values
AI can see cell values and results
Write Values
AI can update cell contents
Read Formulas
AI can see your formulas
Write Formulas
AI can create new formulas
Best Practice: Only grant the minimum permissions needed. Keep formulas hidden to protect your intellectual property.
Create Your Excel Service
Upload an existing Excel file or create a new one directly in the SpreadAPI app, then define which cells or areas should be inputs and outputs.
Step 1: Add Your Spreadsheet
You have two options:
- Upload existing file: Drag and drop your .xlsx or .xls file
- Create new: Start with a blank spreadsheet and build it in the app
Step 2: Define Input Cells/Areas
Select the cells that will receive data from API calls:
- Click on any cell (e.g., B2)
- Click "Add as Input" button
- Give it a meaningful name (e.g., "quantity", "price")
- Set validation rules if needed
Step 3: Define Output Cells/Areas
Select cells containing formulas or results to return:
- Click on result cells (e.g., E10)
- Click "Add as Output"
- Name your outputs (e.g., "total", "monthly_payment")
- Can select ranges for table outputs
Step 4: Publish
Click "Publish Service" to make your API endpoint live and ready to use.
File Specifications
- Formats: .xlsx (Excel 2007+) or .xls (Excel 97-2003)
- Maximum size: 5 MB
- All standard Excel formulas supported
Execute Calculations
Execute your Excel calculations by calling your service endpoint.
Execute Service
GET/POST /api/v1/services/{'service-id}/execute
GET Request Example
GET /api/v1/services/pricing-calculator/execute?quantity=100&discount=0.15&customer_type=enterprise
POST Request Body
{
"inputs": {
"quantity": 100,
"discount": 0.15,
"customer_type": "enterprise"
}
}Response
{
"serviceId": "pricing-calculator",
"inputs": {
"quantity": 100,
"discount": 0.15,
"customer_type": "enterprise"
},
"outputs": [
{
"type": "output",
"name": "total",
"value": 8500
},
{
"type": "output",
"name": "unit_price",
"value": 85
},
{
"type": "output",
"name": "savings",
"value": 1500
}
],
"metadata": {
"executionTime": 23,
"totalTime": 45,
"timestamp": "2024-01-20T10:30:00Z",
"version": "v1"
}
}Notes
- Input keys must match your configured input cells
- Outputs will include all configured output cells
- Results are cached for better performance
- Excel errors (like #DIV/0!) are returned in the response
Error Handling
SpreadAPI returns detailed error information to help you debug issues.
API Errors
// 400 Bad Request
{
"error": "Invalid request",
"message": "Request body must contain "inputs" object",
"serviceId": "pricing-calculator",
"inputs": null
}
// 404 Not Found
{
"error": "Not found",
"message": "Service not found or not published"
}
// 500 Internal Server Error
{
"error": "Internal server error",
"message": "Error details here"
}Excel Calculation Errors
When Excel formulas produce errors, they're returned in the response:
{
"outputs": {
"result": "#DIV/0!",
"status": "#VALUE!"
},
"errors": {
"result": "Division by zero in cell E10",
"status": "Invalid value type in cell C5"
}
}MCP Protocol
The Model Context Protocol (MCP) enables AI assistants like Claude to interact with your Excel spreadsheets securely.
What is MCP?
MCP is a protocol that allows AI assistants to discover and use external tools. SpreadAPI implements MCP to let AI assistants execute your Excel calculations without seeing your formulas.
How It Works
- Discovery: AI assistant discovers your available Excel services
- Permissions: AI sees only what you've allowed (values, not formulas)
- Execution: AI sends inputs, receives calculated outputs
- Security: Your Excel logic stays on SpreadAPI servers
The Addresses
Nothing is installed. SpreadAPI is a remote MCP server that an AI client reaches by address:
- Your own AI:
https://spreadapi.io/mcp— a connection to your account with sign-in, no key. It reaches every service you allow. - Someone else's AI:
https://spreadapi.io/api/mcp/service/<service_id>— the MCP address of one published service, shown under AI → Connect. A protected service asks for a token.
Details: How AI assistants use a service and The MCP address of one service.
Claude Setup
Claude signs in to SpreadAPI; you do not need a key or a configuration file.
Step 1: Copy the Address
In SpreadAPI, open the AI agents page, click Connect an AI and choose Claude. Copy the address:
https://spreadapi.io/mcp
Step 2: Add It in Claude
In Claude: Settings → Connectors → Add → Custom connector. Give it a name and paste the address.
Step 3: Allow Access
Claude opens SpreadAPI in your browser. Sign in and confirm what Claude may do. Step by step: Connect Claude; for ChatGPT see Connect ChatGPT.
Usage Example
Once configured, you can ask Claude to use your Excel services:
User: "Calculate pricing for 500 units with enterprise discount" Claude: "I'll calculate that using your pricing spreadsheet..." [Executes pricing-calculator with quantity=500, customer_type=enterprise] Claude: "Based on your Excel calculations: - Unit price: $45 - Total: $22,500 - Savings: $2,500"
Limitations
SpreadAPI supports most Excel features, but there are some current limitations.
Not Currently Supported:
- VBA macros and custom functions
- External data connections
- Linked workbooks
- Charts (data only, no visuals)
- Excel add-ins
- Files larger than 5 MB
What IS Supported
- All standard Excel functions
- Array formulas and dynamic arrays
- Pivot tables (calculated values)
- Named ranges
- Multiple worksheets
- Data validation
- Conditional formatting (as metadata)
Pricing
Simple, transparent pricing that scales with your usage.
Basic
€0/month
- 1 published service, online permanently
- Unlimited drafts up to 5 MB to build and test
- 1,000 API calls/month
- Published service up to 250 KB
- AI Integration (MCP)
Pro
€99/month
- Unlimited published services
- 10,000 API calls/month included
- 10 MB for all published services together
- AI Integration (MCP)
- Priority support
Custom
By agreement
- Call volume by agreement
- Larger workbooks
- On-premises runtime
- Advanced analytics
- Contract and support by agreement
When the calls of the month are used up, calls are refused until the 1st of the next month. See the pricing page for the current plans. Need more? Contact us for a Custom plan.
Support
Getting Help
Common Issues
Token Not Working
- Check for extra spaces in the token
- Ensure you're using "Bearer" prefix
- Verify the token belongs to this service and hasn't expired
Excel Formulas Not Working
- Check if you're using VBA (not supported)
- Verify no external data connections
- Check the workbook size: a published service may be up to 250 KB on Basic and 5 MB on Pro
MCP Not Connecting
- Check the address: https://spreadapi.io/mcp for your account
- Allow access on the sign-in page that your AI client opens
- For one service's MCP address, make sure the service is published