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

相关推荐
麻邻国官方3 小时前
设计一个多品类牌类AI决策API:接口规范、架构与性能优化
api
softbangong7 小时前
815-批量Excel文件合并工具,批量excel文件、工作表合并软件
linux·windows·excel·文件合并·excel合并·数据整理
城数派7 小时前
2000-2024年1km精度人口分布栅格数据(全球/全国/分省/分市)
arcgis·信息可视化·数据分析·excel
城数派7 小时前
1984-2024年中国10米分辨率城市土地利用栅格数据(商业、公服、居住等9类)
arcgis·信息可视化·数据分析·excel
城数派8 小时前
2015-2024年我国1km分辨率逐日地表温度(LST)栅格数据
数据库·arcgis·信息可视化·数据分析·excel
城数派8 小时前
中国全国土壤有机碳密度数据集(2010-2024年)
数据库·arcgis·信息可视化·数据分析·excel
菜鸟程序员专写BUG9 小时前
SpringBoot 接口返回异常全集|JSON解析失败/响应乱码/状态码错误完美解决
spring boot·后端·json
张涛酱10745612 小时前
Jackson 严格解析:拒绝"温柔"的 JSON
spring boot·json
nilm6112 小时前
作为前端请使用vue2,elementUI框架 根据后端返回的json 生成表格.
前端·elementui·json
Python大数据分析@13 小时前
Pandas相比Excel的优势是哪些?
excel·pandas