Skip to content
Simple IP to lat/long API application using the MaxMind GeoLite database.
C Shell Perl Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
ext/GeoIP-1.4.6 First import
vendor/isolate-2.1.1 First import
.gitignore First import
.rvmrc First import
app.rb First import First import
init.rb First import

Sinatra GeoIP App

Extremely simple IP to Lat/Long API demo. Use at your own risk.


Geoffrey Grosenbach


  • Build ext/GeoIP-1.4.6 (./configure && make && sudo make install)
  • Download binary GeoLiteCity.dat database from
  • Put GeoLiteCity.dat in "./data"
  • Isolate will install other dependencies when you launch the app.


rackup -p 3000


View JSON data for an IP address with:


    latitude: 47.684700012207
    country_name: "United States"
    area_code: 206
    city: "Seattle"
    region: "WA"
    longitude: -122.384803771973
    postal_code: "98117"
    country_code3: "USA"
    country_code: "US"
    dma_code: 819


This product includes GeoLite data created by MaxMind, available from

Something went wrong with that request. Please try again.