Shanghai, China — City Data API

Country: CN Pop: 24.9 million

Shanghai is a city in China (CN). Get Shanghai geographic data, postal codes and location info via the Country Data API REST endpoints. Query by country code 'CN' to retrieve Shanghai data. Free to start, JSON, plans from $9.99/mo.

Shanghai location data via REST API

Use country code CN to query cities and zip codes that include Shanghai.

All cities of China

List every city in China

Cities by country

Zip codes in China

Postal code dataset for China

Get zip codes

API Request Example

Fetch cities in China (CN) — your response will include Shanghai.

Cities by country

GET https://api.countrydataapi.com/v1/cities/by-country?country=CN

Authorization: Bearer YOUR_API_KEY

cURL example

curl "https://api.countrydataapi.com/v1/cities/by-country?country=CN"   -H "Authorization: Bearer YOUR_KEY"

Access Shanghai data via API

Integrate Shanghai (China) into your application. One API for all countries, states, cities and zip codes.