Geocoder - United States Census Bureau

FREE
By eec19846
Updated 5 months ago
8.7/10
Popularity Score
2728ms
Latency
100%
Success Rate

Geocoder - United States Census Bureau API Documentation

Census geocoder provides interactive & programmatic (REST) access to users interested in matching addresses to geographic locations and entities containing those addresses.

View API Details
GETGeocoding for an address
GETGeocoding and Geolookup for an address
GETGeocoding for an address

Returns a geocode for a specified address

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
addressSTRING
REQUIREDA single line containing the full address to be searched
benchmarkSTRING
REQUIREDA numerical ID or name that references what version of the locator should be searched.
Optional Parameters
formatSTRING
OPTIONALjson or html
Code Snippet
unirest.get("https://eec19846-geocoder-us-census-bureau-v1.p.rapidapi.com/locations/onelineaddress?format=json&address=1+Embarcadero+street+San+Francisco&benchmark=Public_AR_Current")
.header("X-RapidAPI-Host", "eec19846-geocoder-us-census-bureau-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://eec19846-geocoder-us-census-bureau-v1.p.rapidapi.com/locations/onelineaddress
Request Method: GET
Response Headers
"cache-control": "private, no-store"
"content-language": "en-US"
"content-type": "application/json"
"date": "Tue, 23 Jul 2019 21:21:51 GMT"
"server": "RapidAPI-1.0.20"
"strict-transport-security": "max-age=31536000"
"vary": "Origin"
"x-content-type-options": "nosniff"
"x-frame-options": "Deny"
"x-oracle-dms-ecid": "9cc0ea6e-dcb8-436d-a5b8-528c3721a603-006c9445"
"x-oracle-dms-rid": "0"
"x-rapidapi-region": "AWS - us-east-1"
"x-rapidapi-version": "1.0.20"
"content-length": "245"
"connection": "Close"
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://eec19846-geocoder-us-census-bureau-v1.p.rapidapi.com/locations/onelineaddress?format=json&address=1+Embarcadero+street+San+Francisco&benchmark=Public_AR_Current")
.header("X-RapidAPI-Host", "eec19846-geocoder-us-census-bureau-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication