How to improve OpenWeather API's performance and reliability for users in China
How to improve OpenWeather API's performance and reliability for users in China
To reduce latency and improve reliability for users connecting from China, we recommend using regional endpoints by adding the cn- prefix to the standard hostname. You can also continue using the standard endpoints if they already meet your needs.
When working with regional endpoints for China, the primary difference is the addition of the cn- prefix to the standard hostname. The request structure, parameters, authentication, and response formats remain unchanged, and your existing API keys continue to work without extra costs or subscriptions. All calls to regional endpoints are counted in your overall API usage statistics.
Endpoint mapping | ||
|---|---|---|
User group / plan | Global | Recommended in China |
Standard API (Free, Startup plans) | ||
Professional (Developer and above plans) |
Recommendation: just add cn- before the hostname.
Global:
https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}Recommended in China:
https://cn-api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}Global:
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat={lat}&lon={lon}&appid={API key}Recommended in China:
https://cn-pro.openweathermap.org/data/2.5/forecast/hourly?lat={lat}&lon={lon}&appid={API key}Notes for Users