At one point I had an idea for a localized web site specifically focusing on a single city. I spoke to several people within that city's government, and it was clear that there was no one single place that kept easily accessible and update-to-date contact information on all the businesses legally operating in the city limits. The closest I came was the chamber of commerce listed all members on their Web site, but these were members only.
I would look into Google Places API for this. You have to register for an API key and the quota is limited to 100,000 requests a day (plus some multipliers on some requests), but it's a rather verbose database.
Here is a request URL to get all "food" places within 500m of the specified latitude-longitude that has the word "harbour" in it:
If you're using Java, I actually developed my own Java wrapper around this API which I believe successfully maps the API 1 to 1 if it fits your purposes: https://github.com/windy1/google-places-api-java
With this library you can just do something like:
Hope this helps!
If the city or county has an open portal it is likely they will have a business license dataset. Otherwise, I would contact the "Revenue/Licensing" department for the City and request a copy in electronic format.
I have a catalog of government open data portals at this link. There are 38 US Cities in the list:
You can use the search endpoints of foursquare api to get contact details of the venues - developer.foursquare.com/docs/venues/search