cURL
curl "https://api.ruseo.cn/api/scenic_search?key=YOUR_API_KEY&words=%E7%BB%B5%E9%98%B3&page=1"
按城市名称搜索全国景点、公园、绿地等坐标信息,返回GCJ02和WGS84经纬度
https://api.ruseo.cn/api/scenic_search
接口调用前需要确认的核心配置。
/api/scenic_searchscenic_search必填参数必须传入,示例值可直接用于联调。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
是 | string | 需要审核通过的 ApiKey。请注册账号获取API Key。 | YOUR_API_KEY |
words |
否 | string | 搜索关键词,通常传市级城市名称 | 绵阳 |
page |
否 | integer | 查询页码,默认第1页,最大100页,每页最多10条 | 1 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/scenic_search?key=YOUR_API_KEY&words=%E7%BB%B5%E9%98%B3&page=1
curl "https://api.ruseo.cn/api/scenic_search?key=YOUR_API_KEY&words=%E7%BB%B5%E9%98%B3&page=1"
$url = 'https://api.ruseo.cn/api/scenic_search?key=YOUR_API_KEY&words=%E7%BB%B5%E9%98%B3&page=1';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/scenic_search?key=YOUR_API_KEY&words=%E7%BB%B5%E9%98%B3&page=1')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "scenic_search",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
code |
integer | 状态码,200表示成功,400表示失败 | 200 |
msg |
string | 返回提示信息 | success |
city |
string | 查询的城市名称 | 绵阳 |
page |
integer | 当前页码 | 1 |
datas |
array | 景点数据集 | [{...}] |
datas.name |
string | 景点名称 | 九皇山 |
datas.longcj02 |
string | GCJ02经度 | 104.689461 |
datas.latgcj02 |
string | GCJ02纬度 | 31.935202 |
datas.lonwgs84 |
string | WGS84经度 | 104.686788 |
datas.latwgs84 |
string | WGS84纬度 | 31.937493 |
点击左侧“发送请求”查看结果...