{"id":13416665,"url":"https://github.com/lionsoul2014/ip2region","last_synced_at":"2026-04-07T03:01:29.066Z","repository":{"id":37357407,"uuid":"45363955","full_name":"lionsoul2014/ip2region","owner":"lionsoul2014","description":"Ip2region is an offline IP-to-Region localization library and IP data management framework with both IPv4 and IPv6 supports, 10-microsecond level query efficiency, xdb search client for many programming languages","archived":false,"fork":false,"pushed_at":"2026-04-04T10:43:42.000Z","size":217293,"stargazers_count":18896,"open_issues_count":3,"forks_count":2986,"subscribers_count":438,"default_branch":"master","last_synced_at":"2026-04-04T11:23:53.710Z","etag":null,"topics":["ip-address","ip-address-database","ip-address-location","ip-location","ip-lookup","ipv4-address","ipv4-lookup","ipv4-support","ipv6-address","ipv6-lookup","ipv6-support","xdb-engine","xdb-ipv4","xdb-ipv6"],"latest_commit_sha":null,"homepage":"https://ip2region.net","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/lionsoul2014.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-11-02T00:43:13.000Z","updated_at":"2026-04-04T10:43:43.000Z","dependencies_parsed_at":"2023-02-18T23:15:38.341Z","dependency_job_id":"b00c9929-7cdb-4acc-a91a-dc3e97823b7b","html_url":"https://github.com/lionsoul2014/ip2region","commit_stats":{"total_commits":541,"total_committers":51,"mean_commits":"10.607843137254902","dds":"0.43068391866913125","last_synced_commit":"89e20ab7b6c63d33c6e7be8f4f393b39ba817a6f"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"purl":"pkg:github/lionsoul2014/ip2region","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionsoul2014%2Fip2region","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionsoul2014%2Fip2region/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionsoul2014%2Fip2region/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionsoul2014%2Fip2region/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lionsoul2014","download_url":"https://codeload.github.com/lionsoul2014/ip2region/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lionsoul2014%2Fip2region/sbom","scorecard":{"id":591843,"data":{"date":"2025-08-11","repo":{"name":"github.com/lionsoul2014/ip2region","commit":"f9402614f6ba808910fc1e330597f873c408b619"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"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":"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":"Maintained","score":10,"reason":"20 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 2/25 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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 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"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T22:08:53.985Z","repository_id":37357407,"created_at":"2025-08-20T22:08:53.985Z","updated_at":"2025-08-20T22:08:53.985Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31498070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"online","status_checked_at":"2026-04-07T02:00:07.164Z","response_time":105,"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":["ip-address","ip-address-database","ip-address-location","ip-location","ip-lookup","ipv4-address","ipv4-lookup","ipv4-support","ipv6-address","ipv6-lookup","ipv6-support","xdb-engine","xdb-ipv4","xdb-ipv6"],"created_at":"2024-07-30T22:00:18.889Z","updated_at":"2026-04-07T03:01:29.061Z","avatar_url":"https://github.com/lionsoul2014.png","language":"Java","funding_links":[],"categories":["Popular","C# #","Go","Java","Uncategorized","\u003ca id=\"a76463feb91d09b3d024fae798b92be6\"\u003e\u003c/a\u003e侦察\u0026\u0026信息收集\u0026\u0026子域名发现与枚举\u0026\u0026OSINT","C#","Library","Java (504)","网络服务","地理位置 Geolocation","C","\u003ca id=\"170048b7d8668c50681c0ab1e92c679a\"\u003e\u003c/a\u003e工具","工具","c","HarmonyOS","网络编程","地理定位( Geolocation )"],"sub_categories":["Uncategorized","\u003ca id=\"05ab1b75266fddafc7195f5b395e4d99\"\u003e\u003c/a\u003e未分类-OSINT","网络服务_其他","其他","Windows Manager"],"readme":":globe_with_meridians: [中文简体](README_zh.md) | [English](README.md)\n\n# ip2region\n\n[ip2region](https://ip2region.net) - is an offline IP address localization library and IP localization data management framework. It supports both `IPv4` and `IPv6` with query efficiency at the 10-microsecond level. It provides `xdb` data generation and query client implementations for many mainstream programming languages.\n\n\n# Features\n\n### 1. Offline Localization Library\n\nThe project itself provides raw data for both IPv4 (`data/ipv4_source.txt`) and IPv6 (`data/ipv6_source.txt`), along with corresponding xdb files (`data/ip2region_v4.xdb` and `data/ip2region_v6.xdb`) to achieve city-level query localization. The field format is: `Country|Province|City|ISP|iso-alpha2-code`. Localization information for China is entirely in Chinese, while regional information for non-China areas is entirely in English.\n\n### 2. Data Management Framework\n\n`xdb` supports hundreds of millions of IP data segment rows. Region information supports full customization. The region information of the built-in data is fixed in the format: `Country|Province|City|ISP|iso-alpha2-Code`. You can append data for specific business needs to the region, such as: GPS information/International Standard Regional Codes/Zip codes, etc. In other words, you can fully use ip2region to manage your own IP localization data.\n\n### 3. Data Deduplication and Compression\n\nThe `xdb` format generation program automatically processes the input raw data, checks and completes the merging of adjacent IP segments, and performs deduplication and compression of identical regional information.\n\n### 4. High-Speed Query Response\n\nEven for queries based entirely on the `xdb` file, the single query response time is at the 10-microsecond level. Memory-accelerated queries can be enabled through the following two methods:\n\n1. `vIndex` Index Caching: Uses a fixed `512KiB` of memory to cache vector index data, reducing one disk IO operation and maintaining average query efficiency within 100 microseconds.\n2. Entire `xdb` File Caching: Loads the entire `xdb` file into memory. Memory usage is equal to the `xdb` file size. There is no disk IO operation, maintaining 10-microsecond level query efficiency.\n\n### 5. Unified Query Interface\n\n`xdb` provides version-compatible query implementations. A unified API can simultaneously provide queries for both IPv4 and IPv6 data and return unified data.\n\n\n# `xdb` Query\n\nFor API introductions, usage documentation, and test programs, please refer to the README introduction under the corresponding `searcher` query client. All query binding implementations are as follows:\n\n| Language | Description | IPv4 Support | IPv6 Support |\n| --- | --- | --- | --- |\n| [Golang](binding/golang/README.md)         | golang query client          | :white_check_mark: | :white_check_mark: |\n| [PHP](binding/php/README.md)               | php query client             | :white_check_mark: | :white_check_mark: |\n| [Java](binding/java/README.md)             | java query client            | :white_check_mark: | :white_check_mark: |\n| [C](binding/c/README.md)                   | C[std=c99] query client      | :white_check_mark: | :white_check_mark: |\n| [Lua_c](binding/lua_c/README.md)           | lua c extension query client | :white_check_mark: | :white_check_mark: |\n| [Lua](binding/lua/README.md)               | lua query client             | :white_check_mark: | :white_check_mark: |\n| [Rust](binding/rust/README.md)             | rust query client            | :white_check_mark: | :white_check_mark: |\n| [Python](binding/python/README.md)         | python query client          | :white_check_mark: | :white_check_mark: |\n| [Javascript](binding/javascript/README.md) | javascript query client      | :white_check_mark: | :white_check_mark: |\n| [Csharp](binding/csharp)                   | csharp query client          | :white_check_mark: | :white_check_mark: |\n| [Erlang](binding/erlang/README.md)         | erlang query client          | :white_check_mark: | :x:                |\n| [Nginx](binding/nginx)                     | nginx extension query client | :white_check_mark: | :white_check_mark: |\n| [C++](binding/cpp/README.md)               | C++ query client             | :white_check_mark: | :white_check_mark: |\n\nThe following toolchain implementations are contributed by community developers via third-party repositories:\n\n| Language | Description |\n| --- | --- |\n| [ip2region-composer](https://github.com/zoujingli/ip2region)    | php composer management client       |\n| [ip2region-ts](https://github.com/Steven-Qiang/ts-ip2region2)   | node.js addon management client      |\n| [ruby-ip2region](https://github.com/jicheng1014/ruby-ip2region) | ruby xdb query client implementation |\n| [Ip2regionTool](https://github.com/orestonce/Ip2regionTool)     | ip2region data conversion tool       |\n\n\n# `xdb` Generation\n\nFor API introductions, usage documentation, and test programs, please refer to the README documents under the following `maker` generation programs:\n\n| Language | Description | IPv4 Support | IPv6 Support |\n| --- | --- | --- | --- |\n| [Golang](maker/golang/README.md) | golang xdb generation program | :white_check_mark: | :white_check_mark: |\n| [Java](maker/java/README.md)     | java xdb generation program   | :white_check_mark: | :white_check_mark: |\n| [Python](maker/python/README.md) | python xdb generation program | :white_check_mark: | :x:                |\n| [Csharp](maker/csharp/README.md) | csharp xdb generation program | :white_check_mark: | :x:                |\n| [Rust](maker/rust/README.md)     | rust xdb generation program   | :white_check_mark: | :white_check_mark: |\n| [C++](maker/cpp)                 | C++ xdb generation program    | :white_check_mark: | :white_check_mark: |\n\n\n# `xdb` Update\n\nThe core of the ip2region project lies in **researching the design and implementation of IP data storage and fast querying**. The raw data `./data/ipv4_source.txt` and `./data/ipv6_source.txt` included in the project are updated irregularly. For scenarios with high requirements for data accuracy and update frequency, it is recommended to purchase commercial offline data from the [Ip2Region Community](https://ip2region.net/products/offline) or third-party vendors. You can try to update the data yourself using the following methods:\n\n### Manual Editing and Updating\n\nYou can modify the data yourself based on the raw IP data provided by ip2region in `./data/ipv4_source.txt` and `./data/ipv6_source.txt` using the editing tools provided by ip2region. Currently, the data sources include:\n\n1. Data provided by the ip2region community (please refer to the official account at the bottom for community notifications)\n2. Project Issues tagged with `[Data_Updates]`\n3. Other custom data: e.g., data provided by customers, data obtained through GPS and WIFI positioning, or legal and compliant data from other platforms.\n\nFor instructions on using the raw IP data editing tools, please refer to the README documents under the following `maker` generation programs:\n\n| Language | Description | IPv4 Support | IPv6 Support |\n| --- | --- | --- | --- |\n| [Golang](maker/golang/README.md#xdb-data-editing) | golang IP raw data editor | :white_check_mark: | :white_check_mark: |\n| [C++](maker/cpp/README.md)                        | C++ IP raw data editor    | :white_check_mark: | :white_check_mark: |\n\n### Detection Automatic Update\n\nIf you want to update data via your own API or data source, you can refer to the update algorithm based on the \"Detection Algorithm\" shared in the following videos to write your own update program:\n\n1. [Data Update Implementation Video Sharing - part1](https://www.bilibili.com/video/BV1934y1E7Q5/)\n2. [Data Update Implementation Video Sharing - part2](https://www.bilibili.com/video/BV1pF411j7Aw/)\n\n\n# Official Community\n\nThe Ip2Region official community was officially launched on `2025/06/12`. On one hand, it provides stable [commercial offline data](https://ip2region.net/products/offline) services. On the other hand, it facilitates the strengthening of the IP toolchain and data services outside the core code, such as [usage documentation](https://ip2region.net/doc/), [query testing](https://ip2region.net/search/demo), and data correction. For more information and services regarding the community, please visit the [Ip2Region Official Community](https://ip2region.net/).\n\n\n# Related Remarks\n\n### 1. xdb Technical Documents:\n\n1. xdb Data Structure Analysis: [\"ip2region xdb - Data Structure Description\"](https://ip2region.net/doc/xdb/structure)\n2. xdb Query Process Analysis: [\"ip2region xdb - Query Process Description\"](https://ip2region.net/doc/xdb/search)\n3. xdb Generation Process Analysis: [\"ip2region xdb - Generation Process Description\"](https://ip2region.net/doc/xdb/generate)\n4. xdb File Generation Tutorial: [\"ip2region xdb - File Generation Tutorial\"](https://ip2region.net/doc/data/xdb_make)\n5. xdb Concurrent Safety Query: [\"ip2region xdb - Concurrent Safety Query\"](https://ip2region.net/doc/xdb/concurrent)\n6. xdb Data Update Method: [\"ip2region Data Update and Use of xdb Data Editor\"](https://mp.weixin.qq.com/s/cZH5qIn4E5rQFy6N32RCzA)\n\n### 3. Technical Information Blogs\n\n1. WeChat Official Account - lionsoul-org, the author's active technical sharing channel\n2. [Ip2Region Official Community](https://ip2region.net)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flionsoul2014%2Fip2region","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flionsoul2014%2Fip2region","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flionsoul2014%2Fip2region/lists"}