Expand description
Geolocation service
This global module can be used to provide geolocation information to blocks that support it.
ipapi.co is the default geolocator service.
§Configuration
§Common Options
| Key | Values | Required | Default |
|---|---|---|---|
rate_limit_interval | Seconds to wait before contacting the service again after it reported rate limiting. Until then, cached results are served and no new requests are made. | No | 600 |
§ipapi.co Options
| Key | Values | Required | Default |
|---|---|---|---|
geolocator | ipapi | Yes | None |
§Ip2Location.io Options
| Key | Values | Required | Default |
|---|---|---|---|
geolocator | ip2location | Yes | None |
api_key | Your Ip2Location.io API key. | No | None |
An api key is not required to get back basic information from ip2location.io. However, to get more additional information, an api key is required. See pricing for more information.
The api_key option can be omitted from configuration, in which case it
can be provided in the environment variable IP2LOCATION_API_KEY
§Examples
Use the default geolocator service:
[geolocator]
geolocator = "ipapi"Use Ip2Location.io
[geolocator]
geolocator = "ip2location"
api_key = "XXX"Structs§
- Geolocator
- Geolocator
Config - IPAddress
Info - Rate
Limited - Error cause set by backends when the service refuses to answer because of
rate limiting. Callers can detect it with
is_rate_limitedand back off instead of retrying, which would only prolong the block.