Need a client side API for determing geo location of IP addresses











up vote
4
down vote

favorite
3












I need a client side API in either Java or Ruby. I would much prefer need this to be LOCAL only. Infact this might not even be an IP, but more of a database import. The thing is that I cannot make use of a web service based one as that is too much heavy I/O for me.



Note: By geolocation, all I really need is country/region at best. I would accept actual lat/long cordinates as well.










share|improve this question




























    up vote
    4
    down vote

    favorite
    3












    I need a client side API in either Java or Ruby. I would much prefer need this to be LOCAL only. Infact this might not even be an IP, but more of a database import. The thing is that I cannot make use of a web service based one as that is too much heavy I/O for me.



    Note: By geolocation, all I really need is country/region at best. I would accept actual lat/long cordinates as well.










    share|improve this question


























      up vote
      4
      down vote

      favorite
      3









      up vote
      4
      down vote

      favorite
      3






      3





      I need a client side API in either Java or Ruby. I would much prefer need this to be LOCAL only. Infact this might not even be an IP, but more of a database import. The thing is that I cannot make use of a web service based one as that is too much heavy I/O for me.



      Note: By geolocation, all I really need is country/region at best. I would accept actual lat/long cordinates as well.










      share|improve this question















      I need a client side API in either Java or Ruby. I would much prefer need this to be LOCAL only. Infact this might not even be an IP, but more of a database import. The thing is that I cannot make use of a web service based one as that is too much heavy I/O for me.



      Note: By geolocation, all I really need is country/region at best. I would accept actual lat/long cordinates as well.







      java ruby api ip-address ip-geolocation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 26 '10 at 22:58









      Jon Seigel

      9,99674785




      9,99674785










      asked Feb 11 '10 at 14:19









      Zombies

      10.5k31121202




      10.5k31121202
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          I was looking at these guys a couple months ago: http://www.maxmind.com/app/geolitecountry



          It seemed OK, for my limited purposes.






          share|improve this answer





















          • They offer a free light-weight CSV file which for me, is perfect. 30mb, all I needed and seems up to date. Thanks. They also offer API's for most all common languages.
            – Zombies
            Feb 11 '10 at 18:46




















          up vote
          2
          down vote













          a quick google search yielded this result: http://www.hostip.info/dl/index.html



          I think it is what you are looking for.






          share|improve this answer





















          • Nice find. It might be really out dated, looking through the sql file i see time stamps from 2003. Also oddly enough 1 line had to be commented out for it to compile. it is a 300mb sql file, and it is taking awhile to exectue (been running for an hour so far).
            – Zombies
            Feb 11 '10 at 18:35










          • so, did i work? i downloaded it but just had a look and didn't install. even if it is from 2003 most IP addresses will be correct :)
            – João Portela
            Feb 13 '10 at 12:28


















          up vote
          2
          down vote













          For a web based one you can use: http://code.google.com/apis/ajaxsearch/. All you do is have:



          <script type="text/javascript" src="http://www.google.com/jsapi?key=yourapikey"></script>


          and now Google populates some javascript variables and in your other js scripts you can now access geographic location using: google.loader.ClientLocation.address.city, google.loader.ClientLocation.address.region, google.loader.ClientLocation.address.country.



          For a very rough and local solution you can get the IP ranges of countries here: http://www.countryipblocks.net/continents/. You can basically store this locally and reference it to get a rough geographic location.






          share|improve this answer





















          • I like this... if you're using any of the google APIs through the loader this variable is populated. Seems pretty accurate too. Nice find.
            – davewasthere
            Jul 25 '11 at 15:14











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f2244989%2fneed-a-client-side-api-for-determing-geo-location-of-ip-addresses%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          I was looking at these guys a couple months ago: http://www.maxmind.com/app/geolitecountry



          It seemed OK, for my limited purposes.






          share|improve this answer





















          • They offer a free light-weight CSV file which for me, is perfect. 30mb, all I needed and seems up to date. Thanks. They also offer API's for most all common languages.
            – Zombies
            Feb 11 '10 at 18:46

















          up vote
          4
          down vote



          accepted










          I was looking at these guys a couple months ago: http://www.maxmind.com/app/geolitecountry



          It seemed OK, for my limited purposes.






          share|improve this answer





















          • They offer a free light-weight CSV file which for me, is perfect. 30mb, all I needed and seems up to date. Thanks. They also offer API's for most all common languages.
            – Zombies
            Feb 11 '10 at 18:46















          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          I was looking at these guys a couple months ago: http://www.maxmind.com/app/geolitecountry



          It seemed OK, for my limited purposes.






          share|improve this answer












          I was looking at these guys a couple months ago: http://www.maxmind.com/app/geolitecountry



          It seemed OK, for my limited purposes.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 11 '10 at 14:24









          Pointy

          311k44450511




          311k44450511












          • They offer a free light-weight CSV file which for me, is perfect. 30mb, all I needed and seems up to date. Thanks. They also offer API's for most all common languages.
            – Zombies
            Feb 11 '10 at 18:46




















          • They offer a free light-weight CSV file which for me, is perfect. 30mb, all I needed and seems up to date. Thanks. They also offer API's for most all common languages.
            – Zombies
            Feb 11 '10 at 18:46


















          They offer a free light-weight CSV file which for me, is perfect. 30mb, all I needed and seems up to date. Thanks. They also offer API's for most all common languages.
          – Zombies
          Feb 11 '10 at 18:46






          They offer a free light-weight CSV file which for me, is perfect. 30mb, all I needed and seems up to date. Thanks. They also offer API's for most all common languages.
          – Zombies
          Feb 11 '10 at 18:46














          up vote
          2
          down vote













          a quick google search yielded this result: http://www.hostip.info/dl/index.html



          I think it is what you are looking for.






          share|improve this answer





















          • Nice find. It might be really out dated, looking through the sql file i see time stamps from 2003. Also oddly enough 1 line had to be commented out for it to compile. it is a 300mb sql file, and it is taking awhile to exectue (been running for an hour so far).
            – Zombies
            Feb 11 '10 at 18:35










          • so, did i work? i downloaded it but just had a look and didn't install. even if it is from 2003 most IP addresses will be correct :)
            – João Portela
            Feb 13 '10 at 12:28















          up vote
          2
          down vote













          a quick google search yielded this result: http://www.hostip.info/dl/index.html



          I think it is what you are looking for.






          share|improve this answer





















          • Nice find. It might be really out dated, looking through the sql file i see time stamps from 2003. Also oddly enough 1 line had to be commented out for it to compile. it is a 300mb sql file, and it is taking awhile to exectue (been running for an hour so far).
            – Zombies
            Feb 11 '10 at 18:35










          • so, did i work? i downloaded it but just had a look and didn't install. even if it is from 2003 most IP addresses will be correct :)
            – João Portela
            Feb 13 '10 at 12:28













          up vote
          2
          down vote










          up vote
          2
          down vote









          a quick google search yielded this result: http://www.hostip.info/dl/index.html



          I think it is what you are looking for.






          share|improve this answer












          a quick google search yielded this result: http://www.hostip.info/dl/index.html



          I think it is what you are looking for.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 11 '10 at 14:28









          João Portela

          3,38732848




          3,38732848












          • Nice find. It might be really out dated, looking through the sql file i see time stamps from 2003. Also oddly enough 1 line had to be commented out for it to compile. it is a 300mb sql file, and it is taking awhile to exectue (been running for an hour so far).
            – Zombies
            Feb 11 '10 at 18:35










          • so, did i work? i downloaded it but just had a look and didn't install. even if it is from 2003 most IP addresses will be correct :)
            – João Portela
            Feb 13 '10 at 12:28


















          • Nice find. It might be really out dated, looking through the sql file i see time stamps from 2003. Also oddly enough 1 line had to be commented out for it to compile. it is a 300mb sql file, and it is taking awhile to exectue (been running for an hour so far).
            – Zombies
            Feb 11 '10 at 18:35










          • so, did i work? i downloaded it but just had a look and didn't install. even if it is from 2003 most IP addresses will be correct :)
            – João Portela
            Feb 13 '10 at 12:28
















          Nice find. It might be really out dated, looking through the sql file i see time stamps from 2003. Also oddly enough 1 line had to be commented out for it to compile. it is a 300mb sql file, and it is taking awhile to exectue (been running for an hour so far).
          – Zombies
          Feb 11 '10 at 18:35




          Nice find. It might be really out dated, looking through the sql file i see time stamps from 2003. Also oddly enough 1 line had to be commented out for it to compile. it is a 300mb sql file, and it is taking awhile to exectue (been running for an hour so far).
          – Zombies
          Feb 11 '10 at 18:35












          so, did i work? i downloaded it but just had a look and didn't install. even if it is from 2003 most IP addresses will be correct :)
          – João Portela
          Feb 13 '10 at 12:28




          so, did i work? i downloaded it but just had a look and didn't install. even if it is from 2003 most IP addresses will be correct :)
          – João Portela
          Feb 13 '10 at 12:28










          up vote
          2
          down vote













          For a web based one you can use: http://code.google.com/apis/ajaxsearch/. All you do is have:



          <script type="text/javascript" src="http://www.google.com/jsapi?key=yourapikey"></script>


          and now Google populates some javascript variables and in your other js scripts you can now access geographic location using: google.loader.ClientLocation.address.city, google.loader.ClientLocation.address.region, google.loader.ClientLocation.address.country.



          For a very rough and local solution you can get the IP ranges of countries here: http://www.countryipblocks.net/continents/. You can basically store this locally and reference it to get a rough geographic location.






          share|improve this answer





















          • I like this... if you're using any of the google APIs through the loader this variable is populated. Seems pretty accurate too. Nice find.
            – davewasthere
            Jul 25 '11 at 15:14















          up vote
          2
          down vote













          For a web based one you can use: http://code.google.com/apis/ajaxsearch/. All you do is have:



          <script type="text/javascript" src="http://www.google.com/jsapi?key=yourapikey"></script>


          and now Google populates some javascript variables and in your other js scripts you can now access geographic location using: google.loader.ClientLocation.address.city, google.loader.ClientLocation.address.region, google.loader.ClientLocation.address.country.



          For a very rough and local solution you can get the IP ranges of countries here: http://www.countryipblocks.net/continents/. You can basically store this locally and reference it to get a rough geographic location.






          share|improve this answer





















          • I like this... if you're using any of the google APIs through the loader this variable is populated. Seems pretty accurate too. Nice find.
            – davewasthere
            Jul 25 '11 at 15:14













          up vote
          2
          down vote










          up vote
          2
          down vote









          For a web based one you can use: http://code.google.com/apis/ajaxsearch/. All you do is have:



          <script type="text/javascript" src="http://www.google.com/jsapi?key=yourapikey"></script>


          and now Google populates some javascript variables and in your other js scripts you can now access geographic location using: google.loader.ClientLocation.address.city, google.loader.ClientLocation.address.region, google.loader.ClientLocation.address.country.



          For a very rough and local solution you can get the IP ranges of countries here: http://www.countryipblocks.net/continents/. You can basically store this locally and reference it to get a rough geographic location.






          share|improve this answer












          For a web based one you can use: http://code.google.com/apis/ajaxsearch/. All you do is have:



          <script type="text/javascript" src="http://www.google.com/jsapi?key=yourapikey"></script>


          and now Google populates some javascript variables and in your other js scripts you can now access geographic location using: google.loader.ClientLocation.address.city, google.loader.ClientLocation.address.region, google.loader.ClientLocation.address.country.



          For a very rough and local solution you can get the IP ranges of countries here: http://www.countryipblocks.net/continents/. You can basically store this locally and reference it to get a rough geographic location.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 11 '10 at 15:26









          jhchen

          7,535114575




          7,535114575












          • I like this... if you're using any of the google APIs through the loader this variable is populated. Seems pretty accurate too. Nice find.
            – davewasthere
            Jul 25 '11 at 15:14


















          • I like this... if you're using any of the google APIs through the loader this variable is populated. Seems pretty accurate too. Nice find.
            – davewasthere
            Jul 25 '11 at 15:14
















          I like this... if you're using any of the google APIs through the loader this variable is populated. Seems pretty accurate too. Nice find.
          – davewasthere
          Jul 25 '11 at 15:14




          I like this... if you're using any of the google APIs through the loader this variable is populated. Seems pretty accurate too. Nice find.
          – davewasthere
          Jul 25 '11 at 15:14


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f2244989%2fneed-a-client-side-api-for-determing-geo-location-of-ip-addresses%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)