Actions16
Overview
This node integrates with the AMap (Gaode Map) API to perform polygon-based Point of Interest (POI) searches. It allows users to specify a polygonal area on the map and search for POIs within that area based on keywords and categories. This is particularly useful for applications needing geographic data filtering, such as real estate platforms looking for amenities within a neighborhood, delivery services defining service zones, or travel apps highlighting attractions in a custom region.
For example, a user can define a rectangular polygon by specifying two diagonal corner coordinates and search for restaurants or gas stations inside that area. The node supports detailed filtering by POI types and pagination options to handle large result sets.
Properties
| Name | Meaning |
|---|---|
| 经纬度坐标对 (polygon) | Defines the polygon area for the search. When the polygon is a rectangle, only two corner points (top-left and bottom-right) are needed; otherwise, the first and last coordinate pairs must be identical to close the polygon. Coordinates are input as multiple latitude-longitude pairs separated by commas. Maximum 40 points allowed. |
| 查询关键字 (keywords) | The keyword to search for within the polygon. Only one keyword is supported. If no city is specified and the keyword is generic, results may be broad. Required field. |
| 查询POI类型 (types) | Specifies the POI categories to filter the search results. Users can provide category codes or Chinese category names strictly following the official POI classification table. Multiple categories can be specified, separated by " |
| 选项 (options) | Additional optional parameters: - 按照层级展示子POI数据 (children): Whether to display child POIs hierarchically under their parent POIs ("1") or flat ("0"). - 页码 (page): Page number of results to retrieve, starting at 1. - 每页行数 (offset): Number of results per page. - 返回结果详略 (extensions): Level of detail in returned data, either "基本信息" (base) or "全部信息" (all). |
Output
The node outputs JSON data containing the list of POIs found within the specified polygon matching the keyword and type filters. The structure typically includes:
- Basic information about each POI such as name, location (latitude and longitude), address, and category.
- Depending on the
extensionsoption, additional details like contact info, business hours, and sub-POIs may be included. - Pagination metadata indicating total results and current page.
No binary data output is involved.
Dependencies
- Requires an active AMap API key credential configured in n8n.
- The node sends HTTP requests to the AMap web service endpoint defined by the user's credentials.
- No other external dependencies.
Troubleshooting
- Invalid polygon coordinates: Ensure the polygon coordinates form a valid closed shape. For non-rectangular polygons, the first and last coordinate pairs must be identical.
- Keyword missing or unsupported: The
keywordsproperty is required. Using overly generic keywords without specifying a city may return very broad or empty results. - Category codes mismatch: Use exact category codes or names as per the official AMap POI classification table to avoid empty results.
- API quota exceeded or invalid API key: Check your AMap API key validity and usage limits.
- Pagination issues: Requesting pages beyond available data will return empty results; adjust
pageandoffsetaccordingly.
Links and References
- AMap Official POI API Documentation
- AMap POI Classification Codes and City Codes Table (linked in property description)