AMap高德地图 icon

AMap高德地图

Get information from AMap

Overview

This node integrates with the AMap (Gaode Map) API to retrieve weather information for a specified city. It supports fetching both current weather conditions and forecasted weather data. This node is useful in scenarios where you want to automate weather data retrieval for applications such as travel planning, event scheduling, or environmental monitoring.

For example, you can use this node to get the 7-day weather forecast of a city by providing its city code, enabling your workflow to adapt based on upcoming weather conditions.

Properties

Name Meaning
城市编码 The city code representing the location for which to fetch weather data. For example, "110000" corresponds to Beijing.

The node supports two operations under the "天气" (weather) resource:

  • 获取实况天气: Get current weather conditions.
  • 获取预报天气: Get forecasted weather data.

The property 城市编码 (city code) is required and must be provided as a string.

Output

The node outputs JSON data containing weather information retrieved from the AMap API. Depending on the selected operation:

  • For current weather (获取实况天气), the output includes real-time weather details such as temperature, humidity, wind, etc.
  • For forecast weather (获取预报天气), the output contains extended forecast data including multiple days' weather predictions.

The output JSON structure follows the format returned by the AMap weather API's /weather/weatherInfo endpoint with query parameters specifying the city and type of weather data requested.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for the AMap service to authenticate requests.
  • The base URL for API requests is https://restapi.amap.com/v3.
  • The node uses HTTP GET requests to the /weather/weatherInfo endpoint with query parameters:
    • city: the city code.
    • extensions: "base" for current weather or "all" for forecast.
    • output: fixed to "JSON".

Ensure that the API key has permissions to access the weather API endpoints.

Troubleshooting

  • Invalid City Code: If the city code is incorrect or not supported, the API may return an error or empty results. Verify the city code against AMap's supported codes.
  • API Key Issues: Missing or invalid API keys will cause authentication errors. Confirm that the API key is correctly configured and active.
  • Network Errors: Connectivity issues can prevent successful API calls. Check network settings and retry.
  • Unexpected Response Format: If the API changes its response structure, the node might not parse data correctly. Monitor API updates from AMap.

Links and References

Discussion