https://github.com/koho/geonet
Geolocation Networking Data
https://github.com/koho/geonet
Last synced: about 1 year ago
JSON representation
Geolocation Networking Data
- Host: GitHub
- URL: https://github.com/koho/geonet
- Owner: koho
- Created: 2022-09-21T08:02:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T01:10:59.000Z (about 1 year ago)
- Last Synced: 2025-04-11T02:27:34.241Z (about 1 year ago)
- Language: Go
- Size: 183 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Geolocation Networking Data
## Data source
| Item | Source |
|---------|--------------------------------------------------------------------------------------|
| geoip | https://github.com/v2fly/geoip/releases/latest/download/geoip.dat |
| geosite | https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat |
## Common query parameters
| Query | Type | Description |
|---------|--------|----------------|
| country | string | IP Geolocation |
| format | string | Output format |
## Formatters
### `text` formatter
No other options
### `shell` formatter
| Query | Type | Description |
|--------|--------|---------------------------|
| opt | string | Options for shell command |
### `bind` formatter
| Query | Type | Description |
|---------|--------|-------------------------------|
| include | string | File path of the zone options |
### `dnsmasq` formatter
| Query | Type | Description |
|-------|--------|--------------------|
| dns | string | DNS server address |
### `ros` formatter
| Query | Type | Description |
|-------|--------|-----------------|
| gw | string | Gateway address |
| table | string | Routing table |
## API
### geoip
| Query | Type | Description |
|-------|------|----------------------------|
| type | int | `4` for IPv4; `6` for IPv6 |
Supported formatters:
- `text`
- `shell`
- `ros`
```shell
curl http://127.0.0.1:8080/geoip?country=CN&type=4&format=shell&opt=dev%20pppoe-wan
```
### geosite
Supported formatters:
- `bind`
- `dnsmasq`
```shell
curl http://127.0.0.1:8080/geosite?country=CN&format=bind&include=/etc/bind/named.china.zones
```