Excel to JSON API by WTSolution Documentation

Excel to JSON API by WTSolution Documentation

Introduction

The Excel to JSON API provides a simple way to convert Excel and CSV data into JSON format. This API accepts tab-separated or comma-separated text data and returns structured JSON.

Endpoint

POST https://mcp.wtsolutions.cn/excel-to-json-api

Request Format

The API accepts POST requests with a JSON body containing the following parameter:

Parameter Type Required Description
data string Yes Tab-separated or comma-separated text data with at least two rows (header row + data row)

Example Request

json 复制代码
{
  "data": "Name\tAge\tIsStudent\nJohn Doe\t25\tfalse\nJane Smith\t30\ttrue"
}

Response Format

The API returns a JSON object with the following structure:

Field Type Description
isError boolean Indicates if there was an error processing the request
msg string Status message or error description
data array/object/null Converted JSON data (null if there was an error)

Example Success Response

json 复制代码
{
  "isError": false,
  "msg": "success",
  "data": [
    {
      "Name": "John Doe",
      "Age": 25,
      "IsStudent": false
    },
    {
      "Name": "Jane Smith",
      "Age": 30,
      "IsStudent": true
    }
  ]
}

Example Error Response

json 复制代码
{
  "isError": true,
  "msg": "At least 2 rows are required in Excel Data",
  "data": null
}

Data Type Handling

The API automatically detects and converts different data types:

  • Numbers: Converted to numeric values
  • Booleans: Recognizes 'true'/'false' (case-insensitive) and converts to boolean values
  • Dates: Detects various date formats and converts them appropriately
  • Strings: Treated as string values
  • Empty values: Represented as empty strings

Error Handling

The API returns descriptive error messages for common issues:

  • Excel Data Format Invalid: When input data is not tab-separated or comma-separated
  • At least 2 rows are required: When input data has fewer than 2 rows
  • Blank/Null/Empty cells in the first row not allowed: When header row contains empty cells
  • Server Internal Error: When an unexpected error occurs

Pricing

Free for now.

Donation

https://buymeacoffee.com/wtsolutions

相关推荐
小Lu的开源日常3 小时前
AI模型太多太乱?用 OpenRouter,一个接口全搞定!
人工智能·llm·api
Dolphin_海豚1 天前
electron windows 无边框窗口最大化时的隐藏边框问题
前端·electron·api
星沙丘秋1 天前
Kettle导入Excel文件进数据库时,数值发生错误的一种原因
excel
Tomorrow'sThinker1 天前
✍️ Python 批量设置 Word 文档多级字体样式(标题/正文/名称/小节)
python·自动化·word·excel
VOLUN1 天前
Vue3项目中优雅封装API基础接口:getBaseApi设计解析
前端·vue.js·api
大虫小呓1 天前
50个Python处理Excel示例代码,覆盖95%日常使用场景-全网最全
python·excel
禁默1 天前
Linux Vim 编辑器详解:从入门到进阶(含图示+插件推荐)
linux·vim·excel
面朝大海,春不暖,花不开2 天前
结构化数据格式解析:JSON 与 XML 的技术应用与实践
xml·json
PythonicCC2 天前
Django核心知识点详解:JSON、AJAX、Cookie、Session与用户认证
ajax·django·json