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

相关推荐
我命由我123455 小时前
Excel 表格 - Excel 减少干扰、专注于内容的查看方式
学习·ui·excel·photoshop·表格·ps·美工
北风toto5 小时前
excel数字转文本样式不生效问题
excel
我命由我123455 小时前
Excel 表格 - Excel 单元格添加边框
学习·ui·excel·课程设计·photoshop·ps·美工
admin⁠6 小时前
php 实现 导入excel 带图片导入
php·excel
葡萄城技术团队6 小时前
SpreadJS:让多源数据筛选排序如 Excel 般便捷高效
运维·服务器·excel
Developer-YC6 小时前
像素图生成小程序开发全解析:从图片上传到Excel图纸
java·javascript·图像处理·微信小程序·excel
RestCloud20 小时前
PostgreSQL大表同步优化:如何避免网络和内存瓶颈?
前端·数据库·api
じòぴé南冸じょうげん1 天前
小程序的project.private.config.json是无依赖文件,那可以删除吗?
前端·小程序·json
用户268001379191 天前
淘宝评论API获取JSON数据全流程指南
api
懵逼的小黑子1 天前
excel里面店铺这一列的数据结构是2C【uniteasone17】这种,我想只保留前面的2C部分,后面的【uniteasone17】不要
excel