6

I'm looking to get some data of this page

http://www.greatschools.org/california/san-francisco/schools/?gradeLevels=e&page=2

To do it I need to create the links in this format:

http://www.greatschools.org/'state'/'city'

So at first I need to have a list with all the US cities sorted by state, where can I find that data? Preferably in .csv format or some other machine readable format (I am using Python).

albert
  • 11,885
  • 4
  • 30
  • 57
  • Yes that sounds like the right format. I clicked on the link for Brisbane, CA: http://www.greatschools.org/california/brisbane/schools/. Just don't use quotes. What are you looking for? Standardized test scores by school district or something else? Because Michigan puts aggregated test scores online for each district. (I used to work for a Michigan school.) – Bulrush Jan 06 '16 at 18:12
  • I Just need the distribution of school by zip code for a machine learning project. – Luis Ramon Ramirez Rodriguez Jan 06 '16 at 20:52
  • Schools do not always follow zip code boundaries. 2 schools can share the same zip code boundaries. The zip code is mainly for use by the USPS. We have some really messed up school district boundaries here in Michigan that were developed long ago. – Bulrush Jan 07 '16 at 13:09
  • Many other resources from SO in 2010 http://stackoverflow.com/q/3845006/2327328 – philshem Feb 15 '16 at 19:59

3 Answers3

8

The US Census Bureau also has a national gazeteer file with state and city info, including incorporation information.

For metadata/excel file column please have a look at HERE.

Learner
  • 323
  • 1
  • 10
ako
  • 201
  • 1
  • 3
  • 2
    How much accurate is it. I see its precision is upto 6th decimal places and I checked some points that does not match with the google earth.There are (balance),borough,CDP,City,comunidad,corporation,county,County,government,municipality,Princeton,town,urbana,village in this file but some of them is on road/inside jungle? – Learner Aug 26 '16 at 05:01
6

I have a CSV file you can download that lists all US cities by state. The data was compiled from the US Census 2013 Gazetteer.

http://www.opengeocode.org/download.php#statecity

In case you must have the data from that domain, each state's information is listed on the states index pagef, and follows similar naming conventions. For example, here's Virginia's index page:
http://www.greatschools.org/virginia/
All Cities in Virginia:
http://www.greatschools.org/schools/cities/virginia/VA/
All School Districts in Virginia:
http://www.greatschools.org/schools/districts/Virginia/VA

albert
  • 11,885
  • 4
  • 30
  • 57
Andrew - OpenGeoCode
  • 8,657
  • 17
  • 28
5

You might try using data from the Geonames.org database. You can download gazateer data by country from this list.

Another potential source is the the MaxMind GeoLite2 dataset.

RyanKDalton
  • 169
  • 6