服务介绍

Jess.API 是 api.canself.com 的统一 API 服务:基于 ASP.NET Core 10,以 Kestrel Windows 服务方式承载,由 Caddy 反向代理提供 HTTPS 访问。

当前提供两类接口:

  • 旧版 DES 密钥接口(/Key、/KeyNew、/IV、/UseCode、/Modules)——从旧服务迁移而来,兼容原有调用方;
  • 天气预报 RESTful 接口(/api/WeatherForecast)——由心知天气(Seniverse)V3 API 驱动,提供实况、逐小时与逐日预报。

完整接口说明与在线调试请见 Swagger UI

接口列表

旧版 DES 密钥接口

方法路径说明
GET /Key 返回 DES 密钥
GET /KeyNew 返回新 DES 密钥
GET /IV 返回 8 字节初始向量
GET /UseCode 返回使用授权码
GET /Modules?productid=1 按产品 ID 返回模块列表(参数 productid)

天气预报接口(心知天气 V3 驱动 · 路径前缀 /api/WeatherForecast)

方法路径说明
GET /api/WeatherForecast/now?city=北京 实况天气(温度、湿度、风向风速、天气现象)
GET /api/WeatherForecast/hourly?city=北京 未来 24 小时逐小时预报
GET /api/WeatherForecast/daily?city=北京&days=3 逐日预报(days 1~15,免费用户默认 3 天)
GET /api/WeatherForecast 查询全部模拟预报(?count= 限制返回条数)
GET /api/WeatherForecast/{id} 按 ID 查询模拟预报
POST /api/WeatherForecast 创建模拟预报
PUT /api/WeatherForecast/{id} 更新模拟预报
DELETE /api/WeatherForecast/{id} 删除模拟预报

city 参数支持「北京」「beijing」「39.93:116.40」三种格式;心知天气服务异常时返回 502。

相关网站