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

相关推荐
LeoCrawls17 小时前
Python 读取 JSON 常见报错排查,附完整处理函数
python·json·php
gudufy18 小时前
EasyAdminBlazor Excel 导入源码解析:数据验证、权限与事务如何处理?
excel·blazor·admin
算家云18 小时前
doubao-seed-2-1 系列模型上架算桥 API | 多模态理解能力继续加强!
人工智能·api·token·算力租赁·算力平台
copilot中国版19 小时前
Copilot + Excel鱼骨图:让根因分析从“凭经验”变成“有依据”
人工智能·excel·copilot
泡海椒21 小时前
JQuick-Excel 字段映射实战:用 MAPPING 固化 Excel 表头与业务字段契约
xml·java·开发语言·excel
开开心心就好1 天前
视频模糊怎么修复?免费工具支持批量处理
java·前端·人工智能·智能手机·pdf·excel
Data-Miner1 天前
能处理Excel表的AI怎么选?脚本能复用,一次买断后期不烧 token
大数据·人工智能·excel
星河耀银海1 天前
数据解析:AI返回JSON数据在HTML5中的渲染方法
人工智能·json·html5
三8442 天前
Fastjson 漏洞 · 01 · 认识 Fastjson 与序列化基础
json·fastjson·反序列化
Andreapiki2 天前
数据分析师校招技术备考指南:SQL、Python、统计学、BI学习路径
sql·excel