Get detailed information of a specified city branch, supporting retrieval of branch details through branch ID or URL alias, returning the basic information, content, latitude and longitude of the branch.
Points to note
- The interface supports fetching station details through station ID or URL alias (filename) in two ways
- You need to enable the city substation plugin (PluginPlace) first, otherwise the interface will return an error that the plugin is not enabled
- Substation content supports Markdown rendering, and can be accessed through
renderParameter control - If the station does not exist, the interface will return an error code
Request address
{域名地址}/api/place/detail
Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/place/detail
Request Syntax
GET {域名地址}/api/place/detail?{参数}
Request Headers
This interface involves only public request headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Request parameters
| Field name | Type | Required | Description |
|---|---|---|---|
| id | int | Is | Station ID, if filename is passed, ID does not need to be passed |
| filename | string | No | Station URL alias, either station ID or filename |
| render | bool | No | Whether to perform Markdown rendering, default based on system settings |
Response header
This interface only involves public response headers. For more information, please refer toCommon Request Headers (Common Request Headers).
Return parameters
| Field name | Type | Description |
|---|---|---|
| code | int | Error code |
| msg | string | Error description |
| data | object | result content |
data parameter
| Field name | Type | Description |
|---|---|---|
| id | int | Station ID |
| Title | string | Station Name |
| seo title | string | Station SEO Title |
| URL Token | string | Station URL Alias |
| keywords | string | Station Keywords |
| description | string | Station Description |
| content | string | Station content details |
| parent_id | int | Parent station ID |
| sort | int | Station sorting value |
| Images | string array | Station Banner image |
| Logo | string | Station Logo image |
| thumbnail | string | station thumbnail |
| latitude | Float | latitude |
| longitude | Float | longitude |
| timezone | string | Time Zone |
| status | int | station status |
| has_children | bool | has sub-stations |
| link | string | station frontend link |
| created_time | int | Station release timestamp |
| updated_time | int | Station update timestamp |
| extra | object | Custom field data (may be empty) |
| parents | object[] | Upper station level information |
Usage Example
Request example
Get station details by ID:
GET /api/place/detail?id=1 HTTP/1.1
Host: your-domain.com
Content-Type: application/json
Get station details by URL alias:
GET /api/place/detail?filename=guangzhou HTTP/1.1
Host: your-domain.com
Content-Type: application/json
Response Example
{
"code": 0,
"data": {
"id": 1,
"created_time": 1607308159,
"updated_time": 1657761249,
"title": "广州",
"seo_title": "广州分站 - AnqiCMS",
"keywords": "广州,城市分站",
"url_token": "guangzhou",
"description": "广州城市分站,提供本地化服务",
"content": "<p>广州城市分站介绍内容</p>",
"parent_id": 0,
"sort": 1,
"images": [],
"logo": "https://en.anqicms.com/uploads/logo.png",
"thumb": "https://en.anqicms.com/uploads/thumb_logo.png",
"latitude": 23.129100,
"longitude": 113.264400,
"timezone": "Asia/Shanghai",
"status": 1,
"has_children": true,
"link": "https://en.anqicms.com/guangzhou",
"parents": [],
"extra": {
"phone": "020-12345678",
"address": "广州市天河区"
}
},
"msg": ""
}
error code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Not authorized |
| 200 | API request OK |