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

相关推荐
我叫汪枫1 天前
Python 办公自动化入门:玩转 Excel 与 Word
python·word·excel
Jonathan Star1 天前
JSON-RPC 2.0 详解
qt·rpc·json
缺点内向1 天前
Java: 在 Excel 中插入、提取或删除文本框
java·开发语言·excel
傻啦嘿哟1 天前
Python将Excel工作表转换为PDF:从入门到实战
python·pdf·excel
罗政1 天前
WPS Excel快速进行同表内的单元格差异对比(高亮)
excel·wps
还算善良_1 天前
【XML生成】根据JSON格式化的报文,动态生成XML
xml·json
默默提升实验室2 天前
Excel 数据透视表一键批量合并居中单元格(失效处理办法)
excel
Tony6666888882 天前
EasyExcel导出多张图片
excel
罗政2 天前
WPS Excel如何快速交换列(调整列顺序),删除多个不连续的列
excel·wps
小矮强2 天前
Excel:通过身份证提取出生日期并计算年龄
excel