Skip to content

sypexgeo/sypexgeo4j

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

sypexgeo4j - is a Java REST client for Sypex geo service. Sypex REST API allows to run up to 10000 requests per month for free.

[Build Status] (https://travis-ci.org/sypexgeo/sypexgeo4j)

Maven

<dependency>
    <groupId>com.github.sypexgeo</groupId>
    <artifactId>sypexgeo</artifactId>
    <version>1.0.1</version>
</dependency

Usage

// Initialize client. The 'auth key' may be null
SxGeoResult result = SxRestClient.create("auth key").get("93.92.217.228");
result.setCache(myCacheImpl); // set cache implementation (optional) 

// Most important fields have dedicated fields
result.city.name.en() ➟ "Seattle"
result.city.name.ru() ➟ "Сиэтл"
result.city.timeZone"America/Los_Angeles"
result.region.name.de() ➟ "Washington (Bundesstaat)"
result.country.name.fr() ➟ "États-Unis"

// All values from response are available as attributes
res.country.getStringAttribute(SxValue.AREA)  ➟ "9629091"
res.country.getIntAttribute(SxValue.AREA)  ➟ 9629091

Requirements

Java 1.8+

License

This project available under Apache License Version 2.0

About

Java API for Sypex Geo Web Service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages