4

I have been searching for a few days to find a web service that will provide the State, County, and Place FIPS codes from an address input. Most of the services I've found only provide a State, County, and Census block code.

For example, for the address 4139 S 143rd Cir, Omaha, NE 68137 would return:

State: 31 County: 05 Place: 537000

4 Answers 4

3

It may be a two step process. Geocode the address, get the xy from the geocode result and then send the xy to a county web service with FIPS. You will want to intersect the point.

http://tigerweb.geo.census.gov/ArcGIS/rest/services/Census2010/State_County/MapServer/1/query?text=&geometry={"x":-122,"y": 41,"spatialReference":{"wkid":4326}}&geometryType=esriGeometryPoint&spatialRel=esriSpatialRelIntersects&returnGeometry=false&outFields=STATE,COUNTY&f=json

Returns:

{"displayFieldName":"BASENAME","fieldAliases":{"STATE":"STATE","COUNTY":"COUNTY"},"fields":[{"name":"STATE","type":"esriFieldTypeString","alias":"STATE","length":2},{"name":"COUNTY","type":"esriFieldTypeString","alias":"COUNTY","length":3}],"features":[{"attributes":{"STATE":"06","COUNTY":"089"}}]}

5
  • I really need the Place code as well. I have found several services that will give me the State and County, but not very few options for getting the Place code.
    – Utensil
    Commented Mar 4, 2013 at 22:40
  • What do you mean by places? I'm not an expert on census data, but my understanding is that there are "incorporated places" and "census designated places". Neither cover every address only certain areas -- so you're going to have addresses without places. Census tracts, block groups and blocks do cover everything. Browse this tigerweb.geo.census.gov/ArcGIS/rest/services/…
    – awesomo
    Commented Mar 4, 2013 at 22:56
  • Here is a link describing the Place code that I need. census.gov/geo/www/cob/pl_metadata.html I have seen some sites call a City FIPS code.
    – Utensil
    Commented Mar 4, 2013 at 23:01
  • So that document indicates "Census Designated Places", "Consolidated Cities" and "Incorporated Places" are the layers you're looking for. These separate layers are listed in the services in the link above. You may have to query all 3 to find if a point falls into any of them. I doubt that someone has combined them -- but you could get the data and combine and host them yourself.
    – awesomo
    Commented Mar 4, 2013 at 23:19
  • How reliable is this service? I see that the link is currently broken. Is there an SLA guarantee for the uptime? How would I go about hosting my own site?
    – modulitos
    Commented Sep 28, 2017 at 18:06
2

You can use this one here: https://www.ffiec.gov/geocode/

The page hits a couple different endpoints when a search is made. If all you need are the FIPS codes, you just need this one: https://geomap.ffiec.gov/FFIECGeocMap/GeocodeMap1.aspx/GetGeocodeData

You will need to make a post request with a body like this: {sSingleLine: "123 Main St, Watertown, MA", iCensusYear: "2018"}

Example in Python:

import requests
import json
address = "123 Main St, Watertown, MA" 
geocode_url = 'https://geomap.ffiec.gov/FFIECGeocMap/GeocodeMap1.aspx/GetGeocodeData'
headers = {'content-type':'application/json'}
data = {'sSingleLine': address, 'iCensusYear': "2018"}  
r = requests.post(geocode_url, data = json.dumps(data), headers=headers)
d = r.json()['d']

state_code = d['sStateCode']
county_code = d['sCountyCode']
msa_code = d['sMSACode']
tract_code = d['sTractCode']

Unfortunately, it doesn't look like it gives codes for city or place.

1
  • this returns a 3 digit county code, not the 5 digit FIPS code he's after. Commented Jul 30, 2022 at 10:16
0

Geocodio can add Census FIPS state, county, place, tract, block, and block group codes to addresses via API or spreadsheet upload. You can do batch processing as well as single address.

The address you gave would return this:

State fips:  
31  
County fips:  
31055  
Tract code:  
007409  
Block code:  
3162  
Block group:  
3  
Full fips:  
310550074093162 

You can try a single address for free without any signup required at https://www.geocod.io/try/ (click US Census Identifiers)

Disclosure: I'm one of the founders of Geocodio.

0

Texas A&M GeoServices will provide all the fips codes you are looking for including place fips. https://geoservices.tamu.edu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.