以 AI 机器人身份加入视频会议,提供语音、虚拟形象与屏幕共享四种模式。
文档
google-sheets
试用通过托管 OAuth 的统一网关读写 Google Sheets 数据。
它能做什么
提供对 Google Sheets 的 HTTP 接口访问,支持读取单元格值、写入数据、追加行以及批量更新。覆盖单元格格式化、新建工作表、自动调整列宽、排序与筛选等能力。认证采用 Bearer 令牌配合托管的 OAuth 连接,每个电子表格 ID 会绑定到用户已授权的 Google 账号。文档附带 JavaScript 与 Python 示例,并支持 RAW 和 USER_ENTERED 两种值输入模式。
什么时候用它
- 把表格指定区间读入应用
- 更新或向 Google 表格追加行
- 通过 batchUpdate 设置格式或新增工作表
- 同时挂载多个 Google 账号分别操作表格
技能文档
Google Sheets
Access the Google Sheets API with managed OAuth authentication. Read and write spreadsheet values, create sheets, apply formatting, and perform batch operations.
Quick Start
# Read values from a spreadsheet
curl -s -X GET 'https://gateway.maton.ai/google-sheets/v4/spreadsheets/SPREADSHEET_ID/values/Sheet1!A1:D10' \
-H 'Authorization: Bearer YOUR_API_KEY'
Base URL
https://gateway.maton.ai/google-sheets/v4/spreadsheets/{spreadsheetId}/{endpoint}
The gateway proxies requests to sheets.googleapis.com and automatically injects your OAuth token.
Authentication
All requests require the Maton API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Environment Variable: Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Getting Your API Key
- Sign in at maton.ai
- Go to maton.ai/settings
- Copy your API key
Connection Management
Manage your Google OAuth connections at https://ctrl.maton.ai.
List Connections
curl -s -X GET 'https://ctrl.maton.ai/connections?app=google-sheets&status=ACTIVE' \
-H 'Authorization: Bearer YOUR_API_KEY'
Create Connection
curl -s -X POST 'https://ctrl.maton.ai/connections' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"app": "google-sheets"}'
Get Connection
curl -s -X GET 'https://ctrl.maton.ai/connections/{connection_id}' \
-H 'Authorization: Bearer YOUR_API_KEY'
Response:
{
"connection": {
"connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
"status": "ACTIVE",
"url": "https://connect.maton.ai/?session_token=...",
"app": "google-sheets"
}
}
Open the returned url in a browser to complete OAuth authorization.
Delete Connection
curl -s -X DELETE 'https://ctrl.maton.ai/connections/{connection_id}' \
-H 'Authorization: Bearer YOUR_API_KEY'
Using Multiple Connections
If you have multiple Google accounts connected, specify which to use:
curl -s -X GET 'https://gateway.maton.ai/google-sheets/v4/spreadsheets/SPREADSHEET_ID' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Maton-Connection: {connection_id}'
API Reference
Get Spreadsheet Metadata
GET /google-sheets/v4/spreadsheets/{spreadsheetId}
Get Values
GET /google-sheets/v4/spreadsheets/{spreadsheetId}/values/{range}
Example:
GET /google-sheets/v4/spreadsheets/SHEET_ID/values/Sheet1!A1:D10
Get Multiple Ranges
GET /google-sheets/v4/spreadsheets/{spreadsheetId}/values:batchGet?ranges=Sheet1!A1:B10&ranges=Sheet2!A1:C5
Update Values
PUT /google-sheets/v4/spreadsheets/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED
Content-Type: application/json
{
"values": [
["A1", "B1", "C1"],
["A2", "B2", "C2"]
]
}
Append Values
POST /google-sheets/v4/spreadsheets/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED
Content-Type: application/json
{
"values": [
["New Row 1", "Data", "More Data"],
["New Row 2", "Data", "More Data"]
]
}
Batch Update Values
POST /google-sheets/v4/spreadsheets/{spreadsheetId}/values:batchUpdate
Content-Type: application/json
{
"valueInputOption": "USER_ENTERED",
"data": [
{"range": "Sheet1!A1:B2", "values": [["A1", "B1"], ["A2", "B2"]]},
{"range": "Sheet1!D1:E2", "values": [["D1", "E1"], ["D2", "E2"]]}
]
}
Clear Values
POST /google-sheets/v4/spreadsheets/{spreadsheetId}/values/{range}:clear
Create Spreadsheet
POST /google-sheets/v4/spreadsheets
Content-Type: application/json
{
"properties": {"title": "New Spreadsheet"},
"sheets": [{"properties": {"title": "Sheet1"}}]
}
Batch Update (formatting, add sheets, etc.)
POST /google-sheets/v4/spreadsheets/{spreadsheetId}:batchUpdate
Content-Type: application/json
{
"requests": [
{"addSheet": {"properties": {"title": "New Sheet"}}}
]
}
Common batchUpdate Requests
Update Cells with Formatting
{
"updateCells": {
"rows": [
{"values": [{"userEnteredValue": {"stringValue": "Name"}}, {"userEnteredValue": {"numberValue": 100}}]}
],
"fields": "userEnteredValue",
"start": {"sheetId": 0, "rowIndex": 0, "columnIndex": 0}
}
}
Format Header Row (Bold + Background Color)
{
"repeatCell": {
"range": {"sheetId": 0, "startRowIndex": 0, "endRowIndex": 1, "startColumnIndex": 0, "endColumnIndex": 3},
"cell": {
"userEnteredFormat": {
"backgroundColor": {"red": 0.2, "green": 0.6, "blue": 0.9},
"textFormat": {"bold": true}
}
},
"fields": "userEnteredFormat(backgroundColor,textFormat)"
}
}
Auto-Resize Columns
{
"autoResizeDimensions": {
"dimensions": {"sheetId": 0, "dimension": "COLUMNS", "startIndex": 0, "endIndex": 3}
}
}
Rename Sheet
{
"updateSheetProperties": {
"properties": {"sheetId": 0, "title": "NewName"},
"fields": "title"
}
}
Insert Rows/Columns
{
"insertDimension": {
"range": {"sheetId": 0, "dimension": "ROWS", "startIndex": 1, "endIndex": 3},
"inheritFromBefore": true
}
}
Sort Range
{
"sortRange": {
"range": {"sheetId": 0, "startRowIndex": 1, "endRowIndex": 10, "startColumnIndex": 0, "endColumnIndex": 3},
"sortSpecs": [{"dimensionIndex": 1, "sortOrder": "DESCENDING"}]
}
}
Add Filter
{
"setBasicFilter": {
"filter": {
"range": {"sheetId": 0, "startRowIndex": 0, "endRowIndex": 100, "startColumnIndex": 0, "endColumnIndex": 5}
}
}
}
Delete Sheet
{
"deleteSheet": {"sheetId": 123456789}
}
Value Input Options
RAW- Values are stored as-isUSER_ENTERED- Values are parsed as if typed into the UI (formulas executed, numbers parsed)
Range Notation
Sheet1!A1:D10- Specific rangeSheet1!A:D- Entire columns A through DSheet1!1:10- Entire rows 1 through 10Sheet1- Entire sheetA1:D10- Range in first sheet
Code Examples
JavaScript
// Read values
const response = await fetch(
'https://gateway.maton.ai/google-sheets/v4/spreadsheets/SHEET_ID/values/Sheet1!A1:D10',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
// Write values
await fetch(
'https://gateway.maton.ai/google-sheets/v4/spreadsheets/SHEET_ID/values/Sheet1!A1:B2?valueInputOption=USER_ENTERED',
{
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
},
body: JSON.stringify({
values: [['A1', 'B1'], ['A2', 'B2']]
})
}
);
Python
import os
import requests
# Read values
response = requests.get(
'https://gateway.maton.ai/google-sheets/v4/spreadsheets/SHEET_ID/values/Sheet1!A1:D10',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
# Write values
response = requests.put(
'https://gateway.maton.ai/google-sheets/v4/spreadsheets/SHEET_ID/values/Sheet1!A1:B2',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
params={'valueInputOption': 'USER_ENTERED'},
json={'values': [['A1', 'B1'], ['A2', 'B2']]}
)
Notes
- Range in URL path must be URL-encoded (
!→%21,:→%3A) - Use
valueInputOption=USER_ENTEREDto parse formulas and numbers - Delete spreadsheets via the Google Drive API, not Sheets API
- Sheet IDs are numeric and found in the spreadsheet metadata
Error Handling
| Status | Meaning |
|---|---|
| 400 | Missing Google Sheets connection |
| 401 | Invalid or missing Maton API key |
| 429 | Rate limited (10 req/sec per account) |
| 4xx/5xx | Passthrough error from Google Sheets API |
Resources
常见问题
- 认证是如何完成的?
- 请求在 Authorization 头中携带 Bearer 令牌(MATON_API_KEY),网关会代为转发到 sheets.googleapis.com 并注入对应 Google 账号的 OAuth 令牌。
- 能直接删除整个电子表格吗?
- 不能。文档明确指出删除电子表格需要走 Google Drive API,而不是 Sheets API。
- 接口的速率限制是多少?
- 网关按账号限制为每秒 10 次请求,超出会返回 HTTP 429。
相关技能
诊断生产力系统反复失效的根因,给出最小干预——容量测算、瓶颈定位、可靠的本地记录。
从 AdMapix API 拉取广告创意、应用、榜单和收入预估等数据,原样返回结构化 JSON。
在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。
把自然语言描述转为结构化 JSON,并由 mcp-diagram-generator MCP 服务生成 Draw.io、Mermaid 或 Excalidraw 图表文件。
为自然搜索排名提供站点审计、内容撰写与竞品分析。
byungkyu 的更多技能
浏览全部技能通过托管 OAuth 访问 Microsoft Graph Excel 接口,读写 OneDrive 中的工作簿、工作表、区域、表格与图表。
通过 OAuth 认证网关管理 Stripe 客户、订阅、发票、产品、价格和支付。
通过托管 OAuth 代理访问 YouTube Data API v3,搜索与管理视频、播放列表、频道、订阅和评论。
通过托管 OAuth 代理调用 WooCommerce REST API,管理商品、订单、客户、优惠券、物流、税务等数据。
通过托管 OAuth 认证,访问并管理 ClickUp 工作区、空间、文件夹、清单与任务等数据。
通过托管 OAuth 认证查询并管理 Salesforce CRM 记录。