Skip to content

Commit 79b30e9

Browse files
committed
Added BIN Downloader Script
1 parent 95f13e9 commit 79b30e9

File tree

2 files changed

+420
-0
lines changed

2 files changed

+420
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,20 @@ An outdated BIN database was provided in the databases folder for your testing.
116116

117117
You can also sign up for [IP2Location Web Service](https://www.ip2location.com/web-service/ip2location) to lookup by IP2Location API.
118118

119+
## BIN DOWNLOADER SCRIPT
120+
```
121+
php ip2location_bin_download.php --token DOWNLOAD_TOKEN --file DATABASE_CODE
122+
```
123+
124+
The command above will download the DATABASE_CODE BIN file and unzip the file into ./data folder.
125+
126+
| Parameters | Description |
127+
|---|---|
128+
|token|Download token. You can get your token at your [IP2Location Account Area](https://www.ip2location.com/account) at the Download page.|
129+
|file|Database package. (DB1BIN...DB26BIN, DB1BINIPV6...DB26BINIPV6, DB1LITEBIN...DB11LITEBIN or DB1LITEBINIPV6...DB11LITEBINIPV6) You may login to your [IP2Location Account Area](https://www.ip2location.com/account) and get the package code (or download code) at the Download page. |
130+
131+
For linux user, you can set the **DOWNLOAD_TOKEN** and **DATABASE_CODE** with values in your .env environment and run the command `php ip2location_bin_download.php` for the download.
132+
119133
## IPv4 BIN vs IPv6 BIN
120134
* Use the IPv4 BIN file if you just need to query IPv4 addresses.
121135
* Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.

0 commit comments

Comments
 (0)