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

相关推荐
Alan_753 小时前
京东RESTful商品接口三大异步优化核心
后端·api
崔庆才丨静觅4 小时前
Claude Code 对接 NanoBanana MCP
api·claude·mcp
tsfy20035 小时前
Python批量调整Excel格式,并排版导出PDF
python·pdf·excel
zhangfeng11335 小时前
JupyterLab 里,JSON文件纯文本格式编辑 / 查看
人工智能·json
一个被程序员耽误的厨师6 小时前
04-实践篇-让AI生成可视化页面-ai-json-ui的落地实践
人工智能·ui·json
快乐的哈士奇7 小时前
Gmail-邮件自动处理系统
node.js·自动化·excel
网管NO.18 小时前
MySQL 8.0 JSON 操作 | 新增 / 查询 / 修改,适配新兴业务
数据库·mysql·json
糖果店的幽灵9 小时前
软件测试接口测试从入门到精通:常见接口类型与数据格式
xml·软件测试·json·接口测试·数据格式
七夜zippoe11 小时前
DolphinDB HTTP API接入:RESTful数据推送
网络协议·http·api·restful·dolphindb
123的故事1 天前
工具分享(7)-多Excel文件内容查询工具
c#·excel·实用工具