gre / geoip
Geolocation API providing acurrate data and fast responses.
1.1.9
2022-02-01 19:24 UTC
Requires
- php: >=7.4
README
The official PHP library for GRE GeoIP API
Report Issue · Request Feature · API Home Page · API Docs
Requirements
- php: >=7.4
Installation
composer require gre/geoip
Usage
Let's say that we want to get the information of a specific IP Address. So we do the following:
include_once './vendor/autoload.php'; // Using the library use GRE\GeoIP\GeoIP; // Declaring the library's class $GREGeoIP = new GeoIP(); // Setting the API Key $GREGeoIP->setKey('<API-Key>'); // Sending the request and storing the output in a variable $GeoIP_Response = $GREGeoIP->lookup('1.1.1.1'); // Printing the reponse print_r($GeoIP_Response);
Options, Methods and More
You can find the full guide of this package by visiting our Documentation Page.
Credits
License
The MIT License (MIT). Please see License File for more information.