How to improve OpenWeather API's performance and reliability for users in China
Regional endpoints for improved performance and reliability
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:
Standard Example:
https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}Recommended in China:
API call
https://cn-api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}Global:
Professional Example:
https://pro.openweathermap.org/data/2.5/forecast/hourly?lat={lat}&lon={lon}&appid={API key}Recommended in China:
API call
https://cn-pro.openweathermap.org/data/2.5/forecast/hourly?lat={lat}&lon={lon}&appid={API key}Notes for Users
- No extra costs Using the China endpoints does not require any additional payment. Your existing subscription plan and pricing remain exactly the same.
- No changes to limits or quotas All request limits, quotas, and rate restrictions defined by your current plan continue to apply without modification.
- Fully compatible The China endpoints are fully compatible with the global ones. Request structure, parameters, authentication, and response formats remain unchanged.
- Same API key You don’t need to get new API keys, your current API keys work with API endpoints dedicated for users from China.
- Who can use While anyone can technically use the China endpoints, they are designed to improve performance and reliability primarily for users connecting from China.