gre/geoip

Geolocation API providing acurrate data and fast responses.

1.1.9 2022-02-01 19:24 UTC

This package is auto-updated.

Last update: 2022-06-04 13:24:36 UTC


README

The official PHP library for GRE GeoIP API


Report Issue · Request Feature · API Home Page · API Docs

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d4342333833373f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d776869746526636f6c6f723d663238643161 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d4342333833373f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d776869746526636f6c6f723d344635423933 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d4342333833373f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d776869746526636f6c6f723d626c61636b 68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50617472656f6e2d6666343234653f7374796c653d666f722d7468652d6261646765266c6f676f3d70617472656f6e266c6f676f436f6c6f723d7768697465

Packagist Version    GitHub code size in bytes    API Status    License: MIT    Packagist PHP Version Support

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.