How to get OSM latitude and longitude of each zip code polygon for USA

I would like to find the latitude and longitude of each zip code polygon for USA.

At the following link, I can find state, county and city/town levels. But, I cannot find zip-code level polygon data.

Also, is it possible to get the data from C# code ?

I do not want to download the data manually for each zip code one by one.

Any help would be appreciated.


There are no zip code polygons defined for the US. The information we do have was obtained from TIGER, as well as individual survey data points by individuals who collected the zip code.

Postal Zip Codes are proprietary to the US Postal service, and will not be in any public database.

Thanks !

I also need to get data of state and county borders from OSM.

is it possible to get the data from C# code ?

It is hard to get the data manually for 3000+ counties and 50 states.


If all the counties are in OSM, it is almost certain they came from some other machine readable source, and it would be better to use that source directly. Otherwise expect there to be gaps. This looks a likely good starting point:

You’ve already been told about overpass. If C# can issue HTTP GETs, and parse XML responses, it should be able to obtain whatever data is available in OSM. You will need to write suitable code to interpret the XML document object models. My guess is that little work has been done in MS .NET tools for this.


I have been searching an example of C# to access OSM through overpass API for some time.

But, I cannot find one.

I found some applications on

but “OSM common” are for JavaScript.

“The Overpass API has been developed to perform read-only queries to the Openstreetmap database, using a powerful and flexible language known as Overpass QL. This post illustrates the syntax of this language with sample queries.”

Are there examples to show how to call overpass API from C# ?

Or, are there other APIs that can be called from C# to get data from OSM ?

Any help would be appreciated.


Did you try it? may be.
Did you ask me how to do it? No

Activate one state, right mouse, “select next admin level”, export and one state is done.

After that “deselect all children” and deactivate state. Goto next state.

Please don’t do that for more that 2-3 states in one export, because you will kill my server and i’ll have to block your account. If the spinning glass does not finish after about 60 seconds, stop and export.


btw: there is no API yet, may be next year

There may not be direct examples of how to call the overpass API from C#, but the solution is to break the task into smaller parts:

  1. Determine the string that needs to be entered into a browser to get the desired Overpass results.

  2. Look at C# examples using the WebLClient() object. One example is at

  3. Look at C# examples to parse XML such as

The OSM county and state boundaries have all been ‘joined’ from what I have seen. There will always be a question of what is most accurate, but the OSM state and boundaries have been cleaned up, and in some cases the boundaries have been updated to follow physical features where it is known that those features define the boundary.

If you think, OSM-data is wrong or damaged, proof it and fix them. Don’t say: “Take other data from external sources, they may be better”.

That’s the OSM way :wink:


btw: there are a lot of quality tools to check and fix osm-data. e.g “Missing Boundaries” (see link in signature) or OSMI