gsheet-crud

GSheet-CRUD API 使用指南。将 Google Sheets 作为 RESTful API 数据库。当用户需要通过 API 操作 Google Sheets 数据时使用此技能,包括:查询数据(GET)、插入数据(POST)、更新数据(PUT)、删除数据(DELETE)。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gsheet-crud" with this command: npx skills add vkboo/gsheet-crud/vkboo-gsheet-crud-gsheet-crud

GSheet-CRUD API 使用指南

前置条件

1. 分享 Google Sheets 权限

将以下服务账户邮箱添加为 Google Sheets 的编辑者

gsheet-sql@axinan-dev.iam.gserviceaccount.com

2. 数据格式要求

  • 第一行必须是列名(字段名)
  • 数据从第二行开始
nameageemail
John25john@example.com
Jane30jane@example.com

API 端点

https://gsheet-sql.dev.iglooinsure.com/api/{doc_id}/{sheet_name}
  • doc_id: 从 Google Sheets URL 获取 https://docs.google.com/spreadsheets/d/{doc_id}/edit
  • sheet_name: 工作表名称(可选,默认 Sheet1

GET - 查询数据

获取所有数据:

curl 'https://gsheet-sql.dev.iglooinsure.com/api/{doc_id}'

条件查询:

curl 'https://gsheet-sql.dev.iglooinsure.com/api/{doc_id}?name=John&age=25'

响应示例:

[
  {"name": "John", "age": 25, "email": "john@example.com"}
]

POST - 插入数据

插入单条记录:

curl -X POST 'https://gsheet-sql.dev.iglooinsure.com/api/{doc_id}' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Mike", "age": 28, "email": "mike@example.com"}'

批量插入:

curl -X POST 'https://gsheet-sql.dev.iglooinsure.com/api/{doc_id}' \
  -H 'Content-Type: application/json' \
  -d '[
    {"name": "Mike", "age": 28, "email": "mike@example.com"},
    {"name": "Sarah", "age": 35, "email": "sarah@example.com"}
  ]'

PUT - 更新数据

通过查询参数匹配要更新的记录:

curl -X PUT 'https://gsheet-sql.dev.iglooinsure.com/api/{doc_id}?name=John' \
  -H 'Content-Type: application/json' \
  -d '{"age": 26, "email": "new_email@example.com"}'

DELETE - 删除数据

通过查询参数匹配要删除的记录:

curl -X DELETE 'https://gsheet-sql.dev.iglooinsure.com/api/{doc_id}?name=John'

JavaScript 调用示例

const API_BASE = 'https://gsheet-sql.dev.iglooinsure.com/api';
const DOC_ID = 'your_doc_id';

// 查询
const data = await fetch(`${API_BASE}/${DOC_ID}?name=John`).then(r => r.json());

// 插入
await fetch(`${API_BASE}/${DOC_ID}`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Mike', age: 28, email: 'mike@example.com' })
});

// 更新
await fetch(`${API_BASE}/${DOC_ID}?name=John`, {
  method: 'PUT',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ age: 26 })
});

// 删除
await fetch(`${API_BASE}/${DOC_ID}?name=John`, { method: 'DELETE' });

Python 调用示例

import requests

API_BASE = 'https://gsheet-sql.dev.iglooinsure.com/api'
DOC_ID = 'your_doc_id'

# 查询
data = requests.get(f'{API_BASE}/{DOC_ID}', params={'name': 'John'}).json()

# 插入
requests.post(f'{API_BASE}/{DOC_ID}', json={'name': 'Mike', 'age': 28, 'email': 'mike@example.com'})

# 更新
requests.put(f'{API_BASE}/{DOC_ID}', params={'name': 'John'}, json={'age': 26})

# 删除
requests.delete(f'{API_BASE}/{DOC_ID}', params={'name': 'John'})

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

skill-creator

No summary provided by upstream source.

Repository SourceNeeds Review
General

vercel-react-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
General

frontend-design

No summary provided by upstream source.

Repository SourceNeeds Review
General

web-design-guidelines

No summary provided by upstream source.

Repository SourceNeeds Review