高德地图 icon

高德地图

高德地图API,位置转换、定位等

Overview

This node integrates with the 高德地图 (Amap) API, specifically providing access to its 基础API (Basic API) resource for weather queries. It allows users to retrieve weather information based on a city code (adcode). The node supports querying either current weather conditions or weather forecasts.

Common scenarios where this node is useful include:

  • Displaying real-time weather data for a specific city in an application.
  • Fetching weather forecasts to inform planning or decision-making processes.
  • Integrating weather information into dashboards or reports.

For example, a user can input a city adcode and select whether they want the current weather or forecast, then use the output data to show temperature, humidity, or other weather details in their workflow.

Properties

Name Meaning
城市编码 The city’s administrative code (adcode) used to specify the location for the weather query. This is required.
选项 Additional options for the weather query:
- 气象类型: Choose between "实况天气" (current weather) or "预报天气" (weather forecast).

Output

The node outputs JSON data containing the weather information returned by the Amap API for the specified city and weather type. The structure typically includes fields such as temperature, humidity, weather condition descriptions, wind information, and forecast details if requested.

If binary data were involved (e.g., images), it would be summarized here, but this node focuses on JSON weather data only.

Dependencies

  • Requires an API key credential for the 高德地图 (Amap) service.
  • The node expects the base URL and authentication to be configured via n8n credentials.
  • Internet access to call the external Amap API endpoints.

Troubleshooting

  • Missing or invalid city code: Ensure the city adcode is correctly provided; otherwise, the API may return errors or empty results.
  • Invalid API key or authentication failure: Verify that the API key credential is valid and has permissions for the weather API.
  • Network issues or API downtime: Check internet connectivity and Amap service status if requests fail.
  • Incorrect option selection: Selecting unsupported weather types might cause unexpected responses; use only the provided options ("实况天气" or "预报天气").

Links and References

Discussion