Convert Zip code to Google Metro Code?

Unknown Coder picture Unknown Coder · Jul 24, 2010 · Viewed 8.7k times · Source

I know that Google publishes its "metro areas" for adwords. Is there a converter from ZIP code to metro area code available? The metro list I'm referring to is at: http://code.google.com/apis/adwords/docs/developer/adwords_api_us_metros.html

Answer

joe snyder picture joe snyder · Aug 10, 2010

Google's metro names appear to be restricted to USPS post office names, so you can do the conversion with 2 tables:

  • The USPS city-state file, which lists all ZIP codes and the corresponding place names and post office names attached to the ZIP. Beware, this file is updated monthly, and the "free" versions floating around and copied from purchased USPS files are often out of date.

  • Google's metro list, normalized so entries like "Huntsville-Decatur (Florence) AL 691" become "Huntsville AL: 691/Decatur AL: 691/Florence AL: 691".

Find the ZIP in the city-state file, fetch the corresponding post office name, find the post office name in the normalized metro list, fetch the corresponding metro code.