(api info)

Usage

The following API endpoints are available: These endpoints return an XML containing information you can parse.
For both methods, you can use "get-headers" as a valid city to get the column names.

Examples

Data Format

Single City

<data query="irvine, ca"> <full_name>Irvine, CA, US</full_name> <population>256,927</population> <weather>5.0 | 15.0 | 18.2 | 22.8 | 36.7</weather> <city_livability>79</city_livability> <cost_of_living>F</cost_of_living> <housing>D+</housing> <safety>A</safety> <schools>A+</schools> <closest_major_cities> Los Angeles, California, United States (58km), San Diego, California, United States (123km), Tijuana, Baja California, Mexico (150km) </closest_major_cities> <count_nearby_major_cities>4</count_nearby_major_cities> <living_wage>$75,204</living_wage> </data> Weather Format: All temperatures are in Celsius.

Multi-city

<multi citylist="get-headers&irvine,ca&new+york,ny"> <data query="get-headers"> <full_name>Full City Name</full_name> <population>Population</population> <weather>Year-round Weather (ÂșC)</weather> <city_livability>City Livability</city_livability> <cost_of_living>Cost of Living</cost_of_living> <housing>Housing</housing> <safety>Safety</safety> <schools>Schools</schools> <closest_major_cities>Closest Major Cities</closest_major_cities> <count_nearby_major_cities>Nearby Major Cities</count_nearby_major_cities> <living_wage>Living Wages (2a+0k)</living_wage> </data> <data query="irvine,ca"> <full_name>Irvine, CA, US</full_name> <population>256,927</population> <weather>5.0 | 15.0 | 18.2 | 22.8 | 36.7</weather> <city_livability>79</city_livability> <cost_of_living>F</cost_of_living> <housing>D+</housing> <safety>A</safety> <schools>A+</schools> <closest_major_cities> Los Angeles, California, United States (58km), San Diego, California, United States (123km), Tijuana, Baja California, Mexico (150km) </closest_major_cities> <count_nearby_major_cities>4</count_nearby_major_cities> <living_wage>$75,204</living_wage> </data> <data query="new+york,ny"> <full_name>New York City, NY, US</full_name> <population>8,804,190</population> <weather>-7.2 | 10.6 | 14.6 | 19.4 | 35.0</weather> <city_livability>67</city_livability> <cost_of_living>F</cost_of_living> <housing>D+</housing> <safety>F</safety> <schools>C+</schools> <closest_major_cities> Philadelphia, Pennsylvania, United States (130km), Baltimore, Maryland, United States (273km), Boston, Massachusetts, United States (306km) </closest_major_cities> <count_nearby_major_cities>1</count_nearby_major_cities> <living_wage>$64,755</living_wage> </data> </multi>

Invalid City

If we cannot find a city for the given query, we will return an XML with the following data:
Example for searching "invalid city name". <data query="invalid city name"> <full_name> Could not find a city for query="invalid city name" </full_name> <population>N/A</population> <weather>N/A</weather> <city_livability>N/A</city_livability> <cost_of_living>N/A</cost_of_living> <housing>N/A</housing> <safety>N/A</safety> <schools>N/A</schools> <closest_major_cities>N/A</closest_major_cities> <count_nearby_major_cities>N/A</count_nearby_major_cities> <living_wages>N/A</living_wages> </data> This is treated as a regular response, so it will be included in responses for multi-city requests as well.

Google Sheets Integration

You can use the following formulas to import the data into Google Sheets. HINT: for the second call, you can add "get-headers" as the 1st city in your list, and that should create the headers for you.
You can see a complete example here: https://city-data-search.cbdm.app/api/example/