We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Add-Ons
default app icon

GB IP to Nation

By Gilbert Lin
Integrations

Description

Get geo information about your site visitors by their IPs.

With this add-on, you can enable the country information tags in the template. You can also lookup geo information about any specific IPs. You can even use the GB IP to Nation service in your own add-on.

MUST HAVE a valid api key from RapidAPI:// IP Geo Location. After subscription, go to My Apps > {YOUR_APPLICATION} > Security. Please also check the limit around rate/request.

I’m currently supporting this API because they answered my email the fastest. Please let me know if you have any other APIs that you’d like to tap into and I’ll consider adding support to it.

Usage

Global Variables

In templates, you will unlock the following geo information tags: - {gb_ip_to_nation:country} - {gb_ip_to_nation:country_code} - {gb_ip_to_nation:flag} - {gb_ip_to_nation:phone_code} - {gb_ip_to_nation:currency} - {gb_ip_to_nation:currency_code} - {gb_ip_to_nation:timezone} - {gb_ip_to_nation:timezone_code} - {gb_ip_to_nation:is_daylight_saving} (bool)

{if gb_ip_to_nation:country == 'Canada'}
    Awesome!
{/if}

<img src="{gb_ip_to_nation:flag}" alt="National flag of: {gb_ip_to_nation:country}"/>

get_ip_info

You can also get information about a specific IP, like

{exp:gb_ip_to_nation:get_ip_info ip="IP_GOES_HERE" prefix="gb_ip"}
    The national flag of {gb_ip:country} is {gb_ip:flag}, and the currency is {gb_ip:currency_code}.
{/exp:gb_ip_to_nation:get_ip_info}

If the IP information is not found, an error message will be displayed.

IMPORTANT if you only have the free basic plan, this will not work because of the rate limit (one request per second).

For developers

You can use the service like this in your own add-on

$ipService = ee('gb_ip_to_nation:IP2Nation');
if ($ipService->initialize()) {
    $info = $ipService->get(IP_GOES_HERE);
}
Information
Version 1.0.0
Last Update 3 years ago
Compatibility EE 6
License Commercial
Links
  • Support
ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.