返回顶部
g

google-bigquery谷歌大查询

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
675
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

google-bigquery

Google BigQuery

通过托管OAuth认证访问Google BigQuery API。运行SQL查询、管理数据集和表,并大规模分析数据。

快速开始

bash

运行简单查询


python < import urllib.request, os, json
data = json.dumps({query: SELECT 1 as test_value, useLegacySql: False}).encode()
req = urllib.request.Request(https://gateway.maton.ai/google-bigquery/bigquery/v2/projects/{projectId}/queries, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

基础URL

https://gateway.maton.ai/google-bigquery/bigquery/v2/{resource-path}

将{resource-path}替换为实际的BigQuery API端点路径。网关将请求代理到bigquery.googleapis.com并自动注入您的OAuth令牌。

认证

所有请求都需要在Authorization头中包含Maton API密钥:

Authorization: Bearer $MATONAPIKEY

环境变量: 将您的API密钥设置为MATONAPIKEY:

bash
export MATONAPIKEY=YOURAPIKEY

获取您的API密钥

  1. 1. 在maton.ai登录或创建账户
  2. 前往maton.ai/settings
  3. 复制您的API密钥

连接管理

在https://ctrl.maton.ai管理您的Google BigQuery OAuth连接。

列出连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=google-bigquery&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

创建连接

bash
python < import urllib.request, os, json
data = json.dumps({app: google-bigquery}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

获取连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
connection: {
connection_id: c8463a31-e5b4-4e52-9a32-e78dcd7ba7b1,
status: ACTIVE,
creation_time: 2026-02-14T09:02:02.780520Z,
lastupdatedtime: 2026-02-14T09:02:19.977436Z,
url: https://connect.maton.ai/?session_token=...,
app: google-bigquery,
metadata: {}
}
}

在浏览器中打开返回的url以完成OAuth授权。

删除连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

指定连接

如果您有多个Google BigQuery连接,请使用Maton-Connection头指定要使用的连接:

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/google-bigquery/bigquery/v2/projects)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Maton-Connection, c8463a31-e5b4-4e52-9a32-e78dcd7ba7b1)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

如果省略,网关将使用默认(最早)的活动连接。

API参考

项目

列出项目

列出认证用户可访问的所有项目。

bash
GET /google-bigquery/bigquery/v2/projects

响应:
json
{
kind: bigquery#projectList,
projects: [
{
id: my-project-123,
numericId: 822245862053,
projectReference: {
projectId: my-project-123
},
friendlyName: My Project
}
],
totalItems: 1
}

数据集

列出数据集

bash
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets

查询参数:

  • - maxResults - 返回的最大结果数
  • pageToken - 分页令牌
  • all - 如果为true,则包含隐藏数据集

获取数据集

bash
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}

创建数据集

bash
POST /google-bigquery/bigquery/v2/projects/{projectId}/datasets
Content-Type: application/json

{
datasetReference: {
datasetId: my_dataset,
projectId: {projectId}
},
description: My dataset description,
location: US
}

响应:
json
{
kind: bigquery#dataset,
id: my-project:my_dataset,
datasetReference: {
datasetId: my_dataset,
projectId: my-project
},
location: US,
creationTime: 1771059780773
}

更新数据集(PATCH)

bash
PATCH /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}
Content-Type: application/json

{
description: Updated description
}

删除数据集

bash
DELETE /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}

查询参数:

  • - deleteContents - 如果为true,则删除数据集中的所有表(默认:false)

列出表

bash
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables

查询参数:

  • - maxResults - 返回的最大结果数
  • pageToken - 分页令牌

获取表

bash
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}

创建表

bash
POST /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables
Content-Type: application/json

{
tableReference: {
projectId: {projectId},
datasetId: {datasetId},
tableId: my_table
},
schema: {
fields: [
{name: id, type: INTEGER, mode: REQUIRED},
{name: name, type: STRING, mode: NULLABLE},
{name: created_at, type: TIMESTAMP, mode: NULLABLE}
]
}
}

响应:
json
{
kind: bigquery#table,
id: my-project:mydataset.mytable,
tableReference: {
projectId: my-project,
datasetId: my_dataset,
tableId: my_table
},
schema: {
fields: [
{name: id, type: INTEGER, mode: REQUIRED},
{name: name, type: STRING, mode: NULLABLE},
{name: created_at, type: TIMESTAMP, mode: NULLABLE}
]
},
numRows: 0,
type: TABLE
}

更新表(PATCH)

bash
PATCH /google-bigquery/bigquery/v2/pro

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-bigquery-1776420049 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-bigquery-1776420049 技能

通过命令行安装

skillhub install google-bigquery-1776420049

下载

⬇ 下载 google-bigquery v1.0.0(免费)

文件大小: 5.92 KB | 发布时间: 2026-4-17 19:53

v1.0.0 最新 2026-4-17 19:53
Initial release: Google BigQuery API integration with managed OAuth.

- Run SQL queries on Google BigQuery directly via a simple HTTP gateway.
- Manage datasets and tables: create, list, update, and delete.
- Analyze data at scale with authenticated requests using your Maton API key.
- Supports multiple connections and OAuth management through Maton control panel.
- Includes detailed usage examples for authentication, connection management, and core API endpoints.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部