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

相关推荐
IT·陈寒2 小时前
Vue组件props传对象给我整不会了
人工智能·大模型·api·创业·变现·简历优化
有味道的男人3 小时前
得物详情 API|支持实时价格、成色、鉴别服务数据
windows·python·api
1314lay_10074 小时前
通过Sql Server创建EXCEL文件:master..xp_cmdshell
数据库·excel
IT·陈寒6 小时前
JavaScript性能优化完全指南
人工智能·大模型·api·创业·变现·简历优化
KONGWX6 小时前
出险记录查不准,接口核验堵住骗保漏洞
汽车·api
2601_9623008110 小时前
Python + Requests + Pytest + Excel + Allure:接口自动化测试项目实战
python·excel·pytest·allure·requests
ms365copilot11 小时前
Excel Copilot一键美化图表,无需手动调格式
excel·copilot·outlook
2501_9336707912 小时前
内部审计校招的数据化趋势:SQL、Excel、Power BI和证书选择
数据库·sql·excel
Wang's Blog1 天前
Java框架快速入门: Spring Security+OAuth2之自定义认证过滤器实现JSON登录
java·spring·json
淼澄研学1 天前
Win11 Dev Home与WinGet实操:基于JSON的声明式环境配置指南
json