Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

bot-by/ipinfo-api

Repository files navigation

IPinfo API

Unofficial Java wrapper for ipinfo.io IP geolocation API.

Codacy Badge Codacy Coverage Java Version Maven Central Javadoc

Table of Contents

Created by gh-md-toc

Getting started

This can look up:

  • information about your own IP address or someone else,
  • short (one-field) information about IP address.

Usage

You get a ready client

IpInfo client = IpInfo.getInstance("qwerty-token");

or make your own with Feign and Java JSON

IpInfo client = Feign.builder()
                     .client(new Http2Client())
                     .requestInterceptor(new TokenInterceptor("qwerty-token"))
                     .decoder(new JsonDecoder())
                     .target(IpInfo.class, IpInfo.API_LOCATOR);

The token is optional on free plan, see more on IPinfo's pricing page.

Now you get details of your IP address

client.lookup(null);

or someone else

client.lookup("8.8.8.8")

The IPinfo supports IP6 addresses

client.lookup("2001:4860:4860::8888")

The volume of information depends on your plan, see some samples here.

Contributing

Please read Contributing.

History

See Changelog

License

Copyright 2017-2023 Witalij Berdinskich

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Apache License v2.0
License