How to Batch Geocode Using a Ruby Library

This tutorial will show you how to batch geocode an array of addresses and an array of coordinate pairs.

Do you have more than one item to geocode? The Geocodio API can be used to batch geocode an array of addresses or coordinate pairs, taking in as many as 10,000 lookups. This is often a more efficient way of working, as it removes the overhead of having to perform multiple HTTP requests.

To streamline the process of batch geocoding for Ruby and Rails developers, we’ve created a Ruby Library that can easily call the API and retrieve the information you require.

In this article, we will discuss how to use the .geocode() and .reverse() methods to batch geocode a group of addresses, as well as a group of coordinate pairs.

If you’d like to know more details about how to install the Geocodio Gem, configure the API Key or geocode a single address or coordinate pair, check out these previous articles:

How To Geocode A Single Address Using A Ruby Library

How To Reverse Geocode A Pair of Coordinates Using A Ruby Library

Note

As mentioned, the batch geocoder accepts up to 10,000 lookups per batch. Be aware that field appends count as individual lookups. Therefore, a batch geocode of 5,000 addresses with the school field append would count as 10,000 lookups. Geocoding 10,000 lookups can take as much as 600 seconds, so be sure to account for that.

Batch Geocoding: Forward

Once you have installed the Geocodio Gem in your Gemfile, it is simple to get batch geocoding up-and-running. Let’s start with forward geocoding - meaning that we take in an address and return coordinates.

First, be sure to require ‘geocodio/gem’ at the top of the file where you would like to do your geocoding.

Then, create a new instance of the Geocodio::Gem and pass in your API Key.

geocodio = Geocodio::Gem.new(“YOUR API KEY”)

You can now call the .geocode() method on your new geocodio variable. Pass in an array that contains the list of addresses you want to batch geocode. Each address should be contained within an individual string and separated by a comma.

We’ll respond with a JSON object that contains a geocoded version of each of the addresses you provide, including latitude and longitude coordinates, as well as additional information like Accuracy Score and Type.

results = geocodio.geocode(["1109 N Highland St, Arlington, VA 22201", "12187 Darnestown Rd, Gaithersburg, MD 20878", "4961 Elm Street, Bethesda, MD"]) results # => {"results"=>[{"query"=>"1109 N Highland St, Arlington, VA 22201", "response"=>{"input"=>{"address_components"=>{"number"=>"1109", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"1109 N Highland St, Arlington, VA 22201"}, "results"=>[{"address_components"=>{"number"=>"1109", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"1109 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886672, "lng"=>-77.094735}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}]}}, {"query"=>"12187 Darnestown Rd, Gaithersburg, MD 20878", "response"=>{"input"=>{"address_components"=>{"number"=>"12187", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12187 Darnestown Rd, Gaithersburg, MD 20878"}, "results"=>[{"address_components"=>{"number"=>"12187", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12187 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118169, "lng"=>-77.251699}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12185", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12185 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118093, "lng"=>-77.25167}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12189", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12189 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118248, "lng"=>-77.251722}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12183", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12183 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117998, "lng"=>-77.25164}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}]}}, {"query"=>"4961 Elm Street, Bethesda, MD", "response"=>{"input"=>{"address_components"=>{"number"=>"4961", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "state"=>"MD", "country"=>"US"}, "formatted_address"=>"4961 Elm St, Bethesda, MD"}, "results"=>[{"address_components"=>{"number"=>"4961", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4961 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982196, "lng"=>-77.098161}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4959", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4959 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982198, "lng"=>-77.098084}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4963", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4963 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.98239, "lng"=>-77.097993}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Statewide MD"}, {"address_components"=>{"number"=>"4963", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4963 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982195, "lng"=>-77.098244}, "accuracy"=>0.9, "accuracy_type"=>"nearest_rooftop_match", "source"=>"Montgomery"}]}}]}

Batch Geocoding: Reverse

Reverse geocoding is the process of taking a pair of coordinates and returning an address. You can reverse batch geocode by using the .reverse() method.

Set up your file by requiring geocodio/gem and creating an instance of Geocodio::Gem as mentioned in the instructions above.

Then, on your geocodio variable, call .reverse() and pass in an array of coordinate pairs - latitude first, longitude second. The pairs should be provided in individual strings with each string separated by a comma.

We will return address information for the provided coordinates, as well as additional information like Accuracy Score and Accuracy Type.

require ‘geocodio/gem’ geocodio = Geocodio::Gem.new(“YOUR API KEY”) results = geocode.reverse(["38.88674717512318, -77.09464642536076", "39.118308110111954, -77.2516753863881", "38.98237295882022, -77.09805507289941"]) results # => {"results"=>[{"query"=>"38.88674717512318, -77.09464642536076", "response"=>{"results"=>[{"address_components"=>{"number"=>"1109", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"1109 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.886672, "lng"=>-77.094735}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}, {"address_components"=>{"number"=>"3030", "street"=>"Clarendon", "suffix"=>"Blvd", "formatted_street"=>"Clarendon Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"3030 Clarendon Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.886876, "lng"=>-77.094702}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Arlington"}, {"address_components"=>{"number"=>"3020", "street"=>"Clarendon", "suffix"=>"Blvd", "formatted_street"=>"Clarendon Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"3020 Clarendon Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.886969, "lng"=>-77.094529}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Virginia Geographic Information Network (VGIN)"}, {"address_components"=>{"number"=>"3108", "predirectional"=>"N", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"N Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"3108 N Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885773, "lng"=>-77.094955}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1027", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"1027 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.885598, "lng"=>-77.09476}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3059", "predirectional"=>"N", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"N Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"3059 N Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885574, "lng"=>-77.09456}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1079", "predirectional"=>"N", "street"=>"Hudson", "suffix"=>"St", "formatted_street"=>"N Hudson St", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"1079 N Hudson St, Arlington, VA 22201", "location"=>{"lat"=>38.885785, "lng"=>-77.095693}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3100", "street"=>"10th", "suffix"=>"Rd", "postdirectional"=>"N", "formatted_street"=>"10th Rd N", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"3100 10th Rd N, Arlington, VA 22201", "location"=>{"lat"=>38.8852, "lng"=>-77.094709}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1015", "predirectional"=>"N", "street"=>"Highland", "suffix"=>"St", "formatted_street"=>"N Highland St", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"1015 N Highland St, Arlington, VA 22201", "location"=>{"lat"=>38.885058, "lng"=>-77.094687}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1014", "predirectional"=>"N", "street"=>"Hudson", "suffix"=>"St", "formatted_street"=>"N Hudson St", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"1014 N Hudson St, Arlington, VA 22201", "location"=>{"lat"=>38.884985, "lng"=>-77.095586}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"3201", "street"=>"Washington", "suffix"=>"Blvd", "formatted_street"=>"Washington Blvd", "city"=>"Arlington", "county"=>"Arlington County", "state"=>"VA", "zip"=>"22201", "country"=>"US"}, "formatted_address"=>"3201 Washington Blvd, Arlington, VA 22201", "location"=>{"lat"=>38.885989, "lng"=>-77.096909}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}, {"query"=>"39.118308110111954, -77.2516753863881", "response"=>{"results"=>[{"address_components"=>{"number"=>"12191", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12191 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118326, "lng"=>-77.251749}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12189", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12189 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118248, "lng"=>-77.251722}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12193", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12193 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118376, "lng"=>-77.251707}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12187", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12187 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118169, "lng"=>-77.251699}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12185", "street"=>"Darnestown", "suffix"=>"Rd", "formatted_street"=>"Darnestown Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12185 Darnestown Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.118093, "lng"=>-77.25167}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"12184", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12184 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117781, "lng"=>-77.252536}, "accuracy"=>0.44, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"15998", "street"=>"Quince Orchard", "suffix"=>"Rd", "formatted_street"=>"Quince Orchard Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"15998 Quince Orchard Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117888, "lng"=>-77.25293}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12182", "street"=>"McDonald Chapel", "suffix"=>"Dr", "formatted_street"=>"McDonald Chapel Dr", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12182 McDonald Chapel Dr, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119427, "lng"=>-77.251898}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"15986", "street"=>"Quince Orchard", "suffix"=>"Rd", "formatted_street"=>"Quince Orchard Rd", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"15986 Quince Orchard Rd, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117709, "lng"=>-77.253041}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12218", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12218 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.117983, "lng"=>-77.253546}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12135", "street"=>"McDonald Chapel", "suffix"=>"Dr", "formatted_street"=>"McDonald Chapel Dr", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12135 McDonald Chapel Dr, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119872, "lng"=>-77.25132}, "accuracy"=>0.42, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"1036", "street"=>"State Hwy 124", "formatted_street"=>"State Hwy 124", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"1036 State Hwy 124, Gaithersburg, MD 20878", "location"=>{"lat"=>39.119961, "lng"=>-77.250987}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"12114", "street"=>"State Hwy 28", "formatted_street"=>"State Hwy 28", "city"=>"Gaithersburg", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20878", "country"=>"US"}, "formatted_address"=>"12114 State Hwy 28, Gaithersburg, MD 20878", "location"=>{"lat"=>39.116996, "lng"=>-77.249917}, "accuracy"=>0.41, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}, {"query"=>"38.98237295882022, -77.09805507289941", "response"=>{"results"=>[{"address_components"=>{"number"=>"4963", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4963 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.98239, "lng"=>-77.097993}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide MD"}, {"address_components"=>{"number"=>"4940", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4940 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.982529, "lng"=>-77.098032}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4959", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4959 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982198, "lng"=>-77.098084}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4957", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4957 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982201, "lng"=>-77.098002}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Montgomery"}, {"address_components"=>{"number"=>"4962", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4962 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.98247, "lng"=>-77.098252}, "accuracy"=>1, "accuracy_type"=>"rooftop", "source"=>"Statewide MD"}, {"address_components"=>{"number"=>"4984", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4984 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982093, "lng"=>-77.097887}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7300", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"7300 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.982676, "lng"=>-77.098509}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"5000", "street"=>"Hampden", "suffix"=>"Ln", "formatted_street"=>"Hampden Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"5000 Hampden Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.982676, "lng"=>-77.098509}, "accuracy"=>0.46, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7249", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"7249 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.982036, "lng"=>-77.098479}, "accuracy"=>0.45, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"5000", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"5000 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982036, "lng"=>-77.09848}, "accuracy"=>0.45, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"7400", "street"=>"Arlington", "suffix"=>"Rd", "formatted_street"=>"Arlington Rd", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"7400 Arlington Rd, Bethesda, MD 20814", "location"=>{"lat"=>38.98334, "lng"=>-77.098548}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"4919", "street"=>"Montgomery", "suffix"=>"Ln", "formatted_street"=>"Montgomery Ln", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4919 Montgomery Ln, Bethesda, MD 20814", "location"=>{"lat"=>38.983371, "lng"=>-77.097503}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}, {"address_components"=>{"number"=>"4956", "street"=>"Elm", "suffix"=>"St", "formatted_street"=>"Elm St", "city"=>"Bethesda", "county"=>"Montgomery County", "state"=>"MD", "zip"=>"20814", "country"=>"US"}, "formatted_address"=>"4956 Elm St, Bethesda, MD 20814", "location"=>{"lat"=>38.982138, "lng"=>-77.096655}, "accuracy"=>0.43, "accuracy_type"=>"nearest_street", "source"=>"TIGER/Line® dataset from the US Census Bureau"}]}}]}

As you can see in both of these examples, the .geocode() and .reverse() methods will automatically recognize that you want to batch geocode when you enter more than one item - either an address or coordinate pair.

With this tool you can easily integrate batch geocoding into your Ruby application.

Don't have an account? Sign up to get 2,500 free lookups a day.

Create an API Key

API Documentation

See how to integrate geocoding, Census data, and more
Go to Docs

Metabase

Metabase is an easy, open source way for everyone in your organization to ask questions and learn from data.

Create an API Key

Create a free Geocodio API key
Copyright © 2014-2024 Dotsquare LLC, Norfolk, Virginia. All rights reserved.