con un clic
baidu-weather-query
通过百度地图 API 查询国内城市实时天气及未来7天预报,支持行政区划代码和经纬度两种定位方式;适用于天气展示、出行助手等场景。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
通过百度地图 API 查询国内城市实时天气及未来7天预报,支持行政区划代码和经纬度两种定位方式;适用于天气展示、出行助手等场景。
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Generate short videos from a static image using the Kling AI image-to-video API. Use this skill whenever the user wants to animate an image, create a video from a photo, turn a picture into a video clip, or generate AI video from an uploaded image.
基于文本描述生成短视频(5s/10s),适用于电商营销、创意宣传、教育讲解等场景,异步轮询获取结果。
图片生成与编辑(超级版),调用 GPT-Image-2 模型生成和编辑图片。需要 AI 画图、生成图片、编辑图片、多图融合、背景替换、风格转换、电商商品图合成、海报设计、插画创作时优先使用该工具。纯像素操作(文字叠加、加水印、裁剪、缩放)请改用 Pillow,不要触发本工具。
调用百度通用文字识别高精度版 OCR,对图片全部文字内容进行高精度检测识别,支持中英日韩等 20+ 语种,适用于文档数字化、多语言文本提取场景。
根据用户输入的主题自动生成完整 PPT 文件,返回封面图和下载链接;适用于办公汇报、教学课件、产品展示等需要快速生成 PPT 的场景。
识别飞机行程单图片,结构化提取24个字段(乘客、航班、票价、税费等);适用于差旅报销、财务管理、行程记录场景。
| name | baidu-weather-query |
| description | 通过百度地图 API 查询国内城市实时天气及未来7天预报,支持行政区划代码和经纬度两种定位方式;适用于天气展示、出行助手等场景。 |
| license | MIT |
本 skill 封装了百度地图天气查询服务的两个接口,统一由 platform_managed 认证(X-Gateway-Authorization: Bearer ${INTEGRATIONS_API_KEY})。
| 接口 | 方法 | Endpoint | 核心功能 |
|---|---|---|---|
| 国内天气查询 | GET | https://app-bo4w33bsdqm9-api-oLpZbd8ed8wa-gateway.appmiaoda.com/weather/v1/ | 按行政区划代码查询实时天气 + 未来7天预报 |
| 国内经纬度天气查询 | GET | https://app-bo4w33bsdqm9-api-GYX1bnRz2Pxa-gateway.appmiaoda.com/weather/v1/ | 按经纬度查询实时天气 + 未来7天预报 + 24小时逐小时预报 |
定位方式:
| 接口 | 定位参数 | 说明 |
|---|---|---|
| 国内天气查询 | district_id | 行政区划代码,如 110100(北京市) |
| 国内经纬度天气查询 | location | 经纬度坐标,格式:纬度,经度,如 39.915,116.404 |
两个接口均返回 JSON,包含 location(位置信息)、now(实时天气)、forecasts(7天预报)字段。经纬度接口还包含 hourly(24小时逐小时预报)。
平台支持:Web / MiniProgram
两个接口均为 GET 请求,使用 Query Parameters 传参,认证方式统一为 platform_managed。
完整参数表、TypeScript 调用代码见:
references/district-weather-api.md — 按行政区划代码查询天气references/location-weather-api.md — 按经纬度查询天气快速示例(以行政区划代码查询为例):
const apiKey = process.env["INTEGRATIONS_API_KEY"]!;
async function getWeatherByDistrict(districtId: string, dataType = "all"): Promise<unknown> {
const url = new URL("https://app-bo4w33bsdqm9-api-oLpZbd8ed8wa-gateway.appmiaoda.com/weather/v1/");
url.searchParams.set("district_id", districtId);
url.searchParams.set("data_type", dataType);
const response = await fetch(url.toString(), {
method: "GET",
headers: {
"Accept": "application/json",
"X-Gateway-Authorization": `Bearer ${apiKey}`,
},
});
if (!response.ok) throw new Error(`HTTP error: ${response.status}`);
const json = await response.json();
if (json.status !== 0) throw new Error(`API error status: ${json.status}`);
return json.result;
}
每个接口需独立部署一个 Edge Function,前端通过 supabase.functions.invoke 调用。
| 接口 | Edge Function 名称 | references 文件 |
|---|---|---|
| 行政区划代码查询天气 | district-weather | references/district-weather-api.md |
| 经纬度查询天气 | location-weather | references/location-weather-api.md |
完整 Edge Function 代码及前端调用代码见:
references/district-weather-api.mdreferences/location-weather-api.md查询北京市未来 7 天天气预报(按行政区划代码):
const apiKey = Deno.env.get("INTEGRATIONS_API_KEY")!;
const url = new URL("https://app-bo4w33bsdqm9-api-oLpZbd8ed8wa-gateway.appmiaoda.com/weather/v1/");
url.searchParams.set("district_id", "110100"); // 北京市
url.searchParams.set("data_type", "all"); // 返回实时天气 + 7 天预报
const response = await fetch(url.toString(), {
method: "GET",
headers: {
"Accept": "application/json",
"X-Gateway-Authorization": `Bearer ${apiKey}`,
},
});
if (!response.ok) throw new Error(`HTTP error: ${response.status}`);
const json = await response.json();
if (json.status !== 0) throw new Error(`API error status: ${json.status}`);
const { location, now, forecasts } = json.result;
console.log(`城市:${location.city}`);
console.log(`当前温度:${now.temp}°C,天气:${now.text}`);
console.log(`明日预报:${forecasts[1].text_day},最高 ${forecasts[1].high}°C,最低 ${forecasts[1].low}°C`);