I'm looking for a database of URLs for every official city and town website. Ideally this list would be up to date and maintained. Freebase has some of the results and we have every city and town in Vermont from our own internal collection efforts at NearbyFYI but are looking for ways to get the official website(s) for municipalities in the United States. Does such a database yet exist or are we going to have to collect them?
-
I think this has already been asked.– KermitCommented May 18, 2013 at 5:29
-
OK. I didn't see it in my initial search and it wasn't shown as a related item. Mind providing the link to the question?– drikiCommented May 18, 2013 at 15:37
-
@FreshPrinceOfSO -- since you asked the question US City and County Web Data API, I take it you already know the question you're referring to. But this question isn't about city/county databases, it's whether there's a database of URIs for cities/counties. Related maybe, but clearly not the same.– Roger_SCommented May 18, 2013 at 21:51
-
I'm now writing scrapers to pull together this list. My compiled list will be here: github.com/driki/scrapers If others happen to have links to other states that'd be useful.– drikiCommented May 19, 2013 at 19:10
-
This looks to be a large collection of URLs: citytown.info/index.htm but doesn't appear to have an API or machine readable database available. I'll email them.– drikiCommented May 19, 2013 at 21:51
7 Answers
(Disclaimer: I work for the U.S. Treasury but am writing in my personal capacity.)
I do not know of an API that has what you are looking for off the shelf, but I would recommend you look into what information you can already access or request from the official system governing registration in the .gov domain. The .gov domain registration process for cities appears to be managed by General Services Administration (GSA) through the .Gov Domain Name Registration Service. (Note: GSA also manages Data.gov.) Cities appear to have to apply using a separate form. Several points of contact are given on the welcome page of the site, including [email protected] and a toll-free number: 1-877-REG-GOVT.
You may also consider suggesting that this API be made available under the question asked on this site, "What would be particularly useful basic APIs for the US Federal Government to offer?"
-
Thanks for the suggestions. I'll investigate those options and add this API request to the question that you referenced.– drikiCommented May 18, 2013 at 17:11
This is a goal of the DemocracyMap project, which is still nascent.
The DemocracyMap API aims to provide normalized structured data for all of the contact details and other primary information for every government body and government official that represents you. Currently this API is more of a meta-API that aggregates, normalizes, and caches other data sources including geospatial boundary queries, but ultimately it aims to help provide standardized geospatial queries and merge with similar efforts like those based on the Boundary Services API (like OpenNorth Represent).
I don't know of a single website, however, Maryland Municipal League maintains a list of cities and towns in Maryland, and it also includes the names of municipalities that don't have websites.
Most state municipal leagues should have a list, but they won't all be organized the same. For instance, Michigan is one page per letter; Virginia wraps theirs in javascript which is giving my browser fits.
Some municipal leagues will include counties or other forms of local government, so you might need to do some cleaning of the data.
The National League of Cities has a directory of State Municipal Leagues, but I either counted wrong, or there's only 49 entries. (I don't see a listing for Hawaii, which Municipal Insider confirms)
(disclaimer -- I'm a member of MMITA, the Maryland Municipal IT Association)
-
The National League of Cities site was a great pointer. Still have to scrape all 50 states but it's a good start.– drikiCommented May 21, 2013 at 0:58
Have you considered dbpedia?
The following SPARQL query would have the following results.
PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
SELECT ?cityName ?officialWebsite WHERE {
?city rdf:type dbo:City .
?city rdfs:label ?cityName .
?city dbo:country dbr:United_States .
?city dbprop:website ?officialWebsite .
}
You could adapt the SPARQL query in many ways, such as ordering or limiting by state, etc.
The United States Small Business Administration seems to have you covered.
-
Hmm. Almost, there are certainly a number of them there but it is far from comprehensive. Looking at Vermont there are only 16 cities in these results: api.sba.gov/geodata/city_links_for_state_of/vt.json there are 250 towns in Vermont and we have website urls for 170 of them. The results from api.sba.gov/geodata/city_links_for_state_of/ma.json are similar. Not nearly 350 results. Even though it it doesn't appear comprehensive it's a good source and one that we'll consume.– drikiCommented May 17, 2013 at 18:30
-
1In case anyone is interested I scraped the API to create a CSV file with the 5408 URLs for the cities in that API. Scraper and CSV are on GitHub: github.com/driki/scrapers If you have additional URLs please send a pull request.– drikiCommented May 19, 2013 at 18:50
I seem to remember that on the official website for some states you can find links to the official city and/or county websites.
For instance, the State of New Jersey has a page linking to county and municipal websites at http://www.state.nj.us/nj/gov/county/localgov.html
Each state has its own top-level domain name, which I have seen allocated to counties or cities. For instance, you can get to the Sussex County, NJ, site (which lists all its municipal websites) by just putting its name in front of nj.us -- sussex.nj.us. Bergen County is at co.bergen.nj.us, Monmouth County at co.monmouth.nj.us, and so on.
Also, there's a ton of information at HUD's State of the Cities Data Systems (SOCDS). You might find something there that points you to what you're looking for or gives you enough information to try possible sitenames and see what you hit.
-
You might be able get a list of cities & towns from the SOCDS ... but I don't think they link to those municipalities' websites.– JoeCommented May 17, 2013 at 23:56
-
as you've changed your answer ... rfc1480 explains locality naming, but because counties and municipalities may have the same name, it gets messier. Also, around 2004, I attempted to register a .md.us domain, having read 1480... and had no luck figuring out how to get it done. Our town administrator ended up registering a .gov, instead.– JoeCommented May 19, 2013 at 7:51
-
Since a domain like sussex.nj.us is a third-level subdomain of nj.us, clearly somebody at the state level has to manage this. The FAQ at Neustar.us suggests searching for the "delegated manager" at the next higher level (eg, nj.us) using whois.us. And looking up domains randomly, I see montclair.nj.us is being held in reserve by the .us registrar (the aforementioned Neustar.us); instead, my home town uses montclairnjusa.org. In an ideal world our town manager would make use of montclair.nj.us and just redirect to its existing site. If everyone did that, @driki would be set. If only ...– Roger_SCommented May 20, 2013 at 5:04
For Ruby users, there is also Ben Balter's g-man gem to check for .gov or related email addresses: https://github.com/benbalter/gman