返回首页

天气预报查询(新)

接口说明

根据IP生成当天某地的天气情况

接口基本信息

API地址

https://api.tcslw.cn/api/iptq

请求方式

GET

返回格式

JSON

接口状态

正常启用

参数说明

以下参数为接口所需调用信息

名称 是否必填 类型 说明
true ?&city=广州 根据城市查询一周天气
string ?&city=广州&type=week 根据城市查询天气
string ?&ip=47.98.234.90&type=week 根据ip查询一周天气
string ?&type=week 自动获取用户地址一周天气
string ?&ip=47.98.234.90 根据ip查询天气
string weather 自动获取用户地址天气

请求示例

HTTP请求

https://api.tcslw.cn/api/iptq

返回结果

HTTP 200 OK

调用示例

<?php $result = file_get_contents("https://api.tcys.xyz/api/weather"); echo $result; ?>

示例代码

<?php $result = file_get_contents("https://api.tcys.xyz/api/weather"); echo $result; ?>