API DocsAPI Docs
get/api/map/ip
get/api/map/ip
获取请求IP的地理位置信息
Basic Information
Request Method:
get
Request URL:
https://www.lycoo.com/api/map/ip
Tags:
地图服务
Description
获取当前请求的客户端IP地址的地理位置信息
Header Parameters
Header Parameters Explanation
Header parameters are used to pass additional information, such as authentication credentials, content type, etc.
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
Authorization | string | Required | Bearer sha_1234567890abcdef... | The authentication header is used to verify the identity of API requests, containing an access token Format: Bearer {token} |
Response Example
200获取成功
{
"success": true,
"ip": "string",
"country": "string",
"province": "string",
"city": "string"
}
400IP地址格式错误或为内网IP
{
"success": false,
"message": "无法获取请求的IP地址"
}
404无法获取位置信息
{
"success": false,
"message": "无法获取IP位置信息"
}
500服务器错误
{
"success": false,
"message": "获取IP位置信息失败"
}