{"id":28744184,"url":"https://github.com/ipinfo/java","last_synced_at":"2025-10-16T01:50:08.403Z","repository":{"id":41190290,"uuid":"138465463","full_name":"ipinfo/java","owner":"ipinfo","description":"Official Java library for IPinfo API (IP geolocation and other types of IP data)","archived":false,"fork":false,"pushed_at":"2025-07-23T03:29:05.000Z","size":365,"stargazers_count":124,"open_issues_count":6,"forks_count":50,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-09-29T13:49:56.709Z","etag":null,"topics":["api","ip-address","ip-data","ip-geolocation","ipinfo","java"],"latest_commit_sha":null,"homepage":"https://ipinfo.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipinfo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-06-24T08:22:09.000Z","updated_at":"2025-08-13T11:18:51.000Z","dependencies_parsed_at":"2023-01-28T23:15:18.040Z","dependency_job_id":null,"html_url":"https://github.com/ipinfo/java","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ipinfo/java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fjava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fjava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fjava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fjava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipinfo","download_url":"https://codeload.github.com/ipinfo/java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipinfo%2Fjava/sbom","scorecard":{"id":493867,"data":{"date":"2025-08-11","repo":{"name":"github.com/ipinfo/java","commit":"44ddbd19de0aab26099c2d715ab7901d131807cb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":4,"reason":"5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 2/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-w33c-445m-f8w7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T19:56:36.073Z","repository_id":41190290,"created_at":"2025-08-19T19:56:36.074Z","updated_at":"2025-08-19T19:56:36.074Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279138287,"owners_count":26112033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","ip-address","ip-data","ip-geolocation","ipinfo","java"],"created_at":"2025-06-16T11:11:00.263Z","updated_at":"2025-10-16T01:50:08.389Z","avatar_url":"https://github.com/ipinfo.png","language":"Java","readme":"# [\u003cimg src=\"https://ipinfo.io/static/ipinfo-small.svg\" alt=\"IPinfo\" width=\"24\"/\u003e](https://ipinfo.io/) IPinfo Java Client Library\n\n[![License](http://img.shields.io/:license-apache-blue.svg)](LICENSE)\n\nThis is the official Java client library for the [IPinfo.io](https://ipinfo.io) IP address API, allowing you to look up your own IP address, or get any of the following details for an IP:\n\n- [IP geolocation data](https://ipinfo.io/ip-geolocation-api) (city, region, country, postal code, latitude, and longitude)\n- [ASN information](https://ipinfo.io/asn-api) (ISP or network operator, associated domain name, and type, such as business, hosting, or company)\n- [Company data](https://ipinfo.io/ip-company-api) (the name and domain of the business that uses the IP address)\n- [Carrier details](https://ipinfo.io/ip-carrier-api) (the name of the mobile carrier and MNC and MCC for that carrier if the IP is used exclusively for mobile traffic)\n\nCheck all the data we have for your IP address [here](https://ipinfo.io/what-is-my-ip).\n\n### Getting Started\n\nYou'll need an IPinfo API access token, which you can get by signing up for a free account at [https://ipinfo.io/signup](https://ipinfo.io/signup).\n\nThe free plan is limited to 50,000 requests per month, and doesn't include some of the data fields such as IP type and company data. To enable all the data fields and additional request volumes see [https://ipinfo.io/pricing](https://ipinfo.io/pricing)\n\n[Click here to view the Java SDK's API documentation](https://ipinfo.github.io/java/).\n\nThe library also supports the Lite API, see the [Lite API section](#lite-api) for more info.\n\n#### Installation\n\n##### Maven\n\nAdd these values to your pom.xml file:\n\nDependency:\n\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.ipinfo\u003c/groupId\u003e\n        \u003cartifactId\u003eipinfo-api\u003c/artifactId\u003e\n        \u003cversion\u003e3.1.0\u003c/version\u003e\n        \u003cscope\u003ecompile\u003c/scope\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n#### Quick Start\n\n##### IP Information\n\n```java\nimport io.ipinfo.api.IPinfo;\nimport io.ipinfo.api.errors.RateLimitedException;\nimport io.ipinfo.api.model.IPResponse;\n\npublic class Main {\n    public static void main(String... args) {\n        IPinfo ipInfo = new IPinfo.Builder()\n                .setToken(\"YOUR TOKEN\")\n                .build();\n\n        try {\n            IPResponse response = ipInfo.lookupIP(\"8.8.8.8\");\n\n            // Print out the hostname\n            System.out.println(response.getHostname());\n        } catch (RateLimitedException ex) {\n            // Handle rate limits here.\n        }\n    }\n}\n```\n\n##### ASN Information\n\n```java\nimport io.ipinfo.api.IPinfo;\nimport io.ipinfo.api.errors.RateLimitedException;\nimport io.ipinfo.api.model.IPResponse;\n\npublic class Main {\n    public static void main(String... args) {\n        IPinfo ipInfo = new IPinfo.Builder()\n                .setToken(\"YOUR TOKEN\")\n                .build();\n\n        try {\n            ASNResponse response = ipInfo.lookupASN(\"AS7922\");\n\n            // Print out country name\n            System.out.println(response.getCountry());\n        } catch (RateLimitedException ex) {\n            // Handle rate limits here.\n        }\n    }\n}\n```\n\n#### Errors\n\n- `ErrorResponseException`: A runtime exception accessible through the\n  `ExecutionException` of a future. This exception signals that something went\n  wrong when mapping the API response to the wrapper. You probably can't\n  recover from this exception.\n- `RateLimitedException` An exception signaling that you've been rate limited.\n\n##### Lite API\n\nThe library gives the possibility to use the [Lite API](https://ipinfo.io/developers/lite-api) too, authentication with your token is still required.\n\nThe returned details are slightly different from the Core API.\n\n```java\nimport io.ipinfo.api.IPinfoLite;\nimport io.ipinfo.api.errors.RateLimitedException;\nimport io.ipinfo.api.model.IPResponseLite;\n\npublic class Main {\n    public static void main(String... args) {\n        IPinfoLite ipInfoLite = new IPinfoLite.Builder()\n                .setToken(\"YOUR TOKEN\")\n                .build();\n\n        try {\n            IPResponseLite response = ipInfoLite.lookupIP(\"8.8.8.8\");\n\n            // Print out the ASN\n            System.out.println(response.getAsn()); // AS15169\n\n            // Print out the country code\n            System.out.println(response.getCountryCode()); // US\n\n            // Print out the country name\n            System.out.println(response.getCountry()); // United States\n        } catch (RateLimitedException ex) {\n            // Handle rate limits here.\n        }\n    }\n}\n```\n\n#### Caching\n\nThis library provides a very simple caching system accessible in `SimpleCache`.\nSimple cache is an in-memory caching system that resets every time you restart\nyour code.\n\nIf you prefer a different caching methodology, you may use the `Cache`\ninterface and implement your own caching system around your own infrastructure.\n\nThe default cache length is 1 day, this can be changed by calling the\nSimpleCache constructor yourself.\n\n```java\nimport io.ipinfo.api.IPinfo;\nimport io.ipinfo.api.errors.RateLimitedException;\nimport io.ipinfo.api.model.IPResponse;\n\npublic class Main {\n    public static void main(String... args) {\n        // 5 Day Cache\n        IPinfo ipInfo = new IPinfo.Builder()\n                .setToken(\"YOUR TOKEN\")\n                .setCache(new SimpleCache(Duration.ofDays(5)))\n                .build();\n\n        try {\n            IPResponse response = ipInfo.lookupIP(\"8.8.8.8\");\n\n            // Print out the hostname\n            System.out.println(response.getHostname());\n        } catch (RateLimitedException ex) {\n            // Handle rate limits here.\n        }\n    }\n}\n```\n\n#### Country Name Lookup\n\nThis library provides a system to lookup country names through ISO2 country\ncodes.\n\n```java\nimport io.ipinfo.api.IPinfo;\nimport io.ipinfo.api.errors.RateLimitedException;\nimport io.ipinfo.api.model.IPResponse;\n\npublic class Main {\n    public static void main(String... args) {\n        IPinfo ipInfo = new IPinfo.Builder()\n                .setToken(\"YOUR TOKEN\")\n                .build();\n\n        try {\n            IPResponse response = ipInfo.lookupIP(\"8.8.8.8\");\n\n            // Print out the country code\n            System.out.println(response.getCountryCode());\n\n            // Print out the country name\n            System.out.println(response.getCountryName());\n        } catch (RateLimitedException ex) {\n            // Handle rate limits here.\n        }\n    }\n}\n```\n\n#### EU Country Lookup\n\nThis library provides a system to lookup if a country is a member of the European Union (EU) through\nISO2 country codes.\n\n```java\nimport io.ipinfo.api.IPinfo;\nimport io.ipinfo.api.errors.RateLimitedException;\nimport io.ipinfo.api.model.IPResponse;\n\npublic class Main {\n    public static void main(String... args) {\n        IPinfo ipInfo = new IPinfo.Builder()\n                .setToken(\"YOUR TOKEN\")\n                .build();\n\n        try {\n            IPResponse response = ipInfo.lookupIP(\"8.8.8.8\");\n\n            // Print out whether the country is a member of the EU\n            System.out.println(response.isEU());\n        } catch (RateLimitedException ex) {\n            // Handle rate limits here.\n        }\n    }\n}\n```\n\n#### Internationalization\n\nThis library provides a system to lookup if a country is a member of the European Union (EU), emoji and unicode of the country's flag, code and symbol of the country's currency, and public link to the country's flag image as an SVG and continent code and name through ISO2 country codes.\n\n```java\nimport io.ipinfo.api.IPinfo;\nimport io.ipinfo.api.errors.RateLimitedException;\nimport io.ipinfo.api.model.IPResponse;\n\npublic class Main {\n    public static void main(String... args) {\n        IPinfo ipInfo = new IPinfo.Builder()\n                .setToken(\"YOUR TOKEN\")\n                .build();\n\n        try {\n            IPResponse response = ipInfo.lookupIP(\"8.8.8.8\");\n\n            // Print out whether the country is a member of the EU\n            System.out.println(response.isEU());\n\n            // CountryFlag{emoji='🇺🇸',unicode='U+1F1FA U+1F1F8'}\n            System.out.println(response.getCountryFlag());\n\n            // https://cdn.ipinfo.io/static/images/countries-flags/US.svg\n            System.out.println(response.getCountryFlagURL());\n\n            // CountryCurrency{code='USD',symbol='$'}\n            System.out.println(response.getCountryCurrency());\n\n            // Continent{code='NA',name='North America'}\n            System.out.println(response.getContinent());\n        } catch (RateLimitedException ex) {\n            // Handle rate limits here.\n        }\n    }\n}\n```\n\n#### Location Information\n\nThis library provides an easy way to get the latitude and longitude of an IP Address:\n\n```java\nimport io.ipinfo.api.IPinfo;\nimport io.ipinfo.api.errors.RateLimitedException;\nimport io.ipinfo.api.model.IPResponse;\n\npublic class Main {\n    public static void main(String... args) {\n        IPinfo ipInfo = new IPinfo.Builder()\n                .setToken(\"YOUR TOKEN\")\n                .build();\n\n        try {\n            IPResponse response = ipInfo.lookupIP(\"8.8.8.8\");\n\n            // Print out the Latitude and Longitude\n            System.out.println(response.getLatitude());\n            System.out.println(response.getLongitude());\n\n        } catch (RateLimitedException ex) {\n            // Handle rate limits here.\n        }\n    }\n}\n```\n\n#### Extra Information\n\n- This library is thread-safe. Feel free to call the different endpoints from\n  different threads.\n- This library uses Square's http client. Please refer to their documentation\n  to get information on more functionality you can use.\n\n### Other Libraries\n\nThere are official [IPinfo client libraries](https://ipinfo.io/developers/libraries) available for many languages including PHP, Python, Go, Java, Ruby, and many popular frameworks such as Django, Rails, and Laravel. There are also many third-party libraries and integrations available for our API.\n\n### About IPinfo\n\nFounded in 2013, IPinfo prides itself on being the most reliable, accurate, and in-depth source of IP address data available anywhere. We process terabytes of data to produce our custom IP geolocation, company, carrier, VPN detection, hosted domains, and IP type data sets. Our API handles over 40 billion requests a month for 100,000 businesses and developers.\n\n[![image](https://avatars3.githubusercontent.com/u/15721521?s=128\u0026u=7bb7dde5c4991335fb234e68a30971944abc6bf3\u0026v=4)](https://ipinfo.io/)\n","funding_links":[],"categories":["网络编程"],"sub_categories":["Spring Cloud框架"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipinfo%2Fjava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipinfo%2Fjava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipinfo%2Fjava/lists"}