The Javascript library of the API.


  • php: >=7.4


composer require gre/geoip

Importing the library

include_once './vendor/autoload.php';
// Using the library
use GRE\GeoIP\GeoIP;
// Declaring the library's class
$GREGeoIP = new GeoIP();
The $GREGeoIP variable will be used to call the API methods and functions.

Setting the API Key

Before we can use the methods of this library we have to set our API Key. This can be done by calling the setKey function:
DO NOT forget to change the <API-Key> with your own API Key. If you don't have one, please take a look at the Quick Start page.

Methods & Usage

After importing and defining the package you're ready now to use all it's functionalities. The library is consist or 2 main methods.