Get city station list interface

Retrieve the list of city stations, supporting filtering by parent station, whether all stations are included, etc., and return detailed information about the stations.

Points to note

  • This interface is used to retrieve the list information of city stations.
  • You need to enable the city station plugin (PluginPlace) first, otherwise the interface returns an error that it is not enabled
  • Supports retrieving the child stations of a specified upper-level station
  • Supports retrieving all stations or filtering by conditions
  • The stations returned in the list do not includecontentandextraField (only available in detail interface)

Request address

{域名地址}/api/place/list

Description:{域名地址}Replace it with your domain name, such ashttps://en.anqicms.com/api/place/list

Request Syntax

GET /api/place/list

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
parentId int No The parent station, can obtain the child stations under the specified parent station, when parentId="0", get the top-level station. If not provided, all child stations will be retrieved by default.
all bool No Whether to retrieve all sub-stations, all=true to retrieve all sub-stations (including all levels), all=false (default) to retrieve only the direct sub-stations of the specified parentId.
limit int No Display quantity, 'limit' can specify the number of items to display, pagination by how many items, for example, if 'limit' is set to '10', only 10 items will be displayed. 'limit' supports offset mode, i.e.,Delimiter mode, if you want to take 10 data items starting from the 2nd one, you can set it to limit=“2,10”.

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 result item 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
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 Does the station have a sub-station
is_current bool Is it the current station
link string Station front-end link
created_time int Station release timestamp
updated_time int Station update timestamp

Usage Example

Request example

Get the list of top-level stations:

GET /api/place/list?parentId=0 HTTP/1.1
Host: www.anqicms.com

Get the child stations of a specified parent station:

GET /api/place/list?parentId=1 HTTP/1.1
Host: www.anqicms.com

Get all stations (unlimited levels):

GET /api/place/list?all=true HTTP/1.1
Host: www.anqicms.com

Station list with offset and limit:

GET /api/place/list?parentId=0&limit=0,10 HTTP/1.1
Host: www.anqicms.com

Response Example

{
  "code": 0,
  "data": [
    {
      "id": 1,
      "created_time": 1607308159,
      "updated_time": 1657761249,
      "title": "广州",
      "seo_title": "",
      "keywords": "",
      "url_token": "guangzhou",
      "description": "",
      "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,
      "is_current": false,
      "link": "https://en.anqicms.com/guangzhou"
    },
    {
      "id": 2,
      "created_time": 1607308159,
      "updated_time": 1657761249,
      "title": "深圳",
      "seo_title": "",
      "keywords": "",
      "url_token": "shenzhen",
      "description": "",
      "parent_id": 0,
      "sort": 2,
      "images": [],
      "logo": "",
      "thumb": "https://en.anqicms.com/uploads/thumb_default.png",
      "latitude": 22.543100,
      "longitude": 114.057900,
      "timezone": "Asia/Shanghai",
      "status": 1,
      "has_children": false,
      "is_current": false,
      "link": "https://en.anqicms.com/shenzhen"
    }
  ],
  "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