PHPackages                             gre/geoip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. gre/geoip

ActiveLibrary[API Development](/categories/api)

gre/geoip
=========

Greip, protects your business from fraud and abuse by deploying AI-powered modules into your system.

2.3.0(2y ago)2231Apache-2.0PHPPHP &gt;=7.4

Since Jan 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Greipio/php)[ Packagist](https://packagist.org/packages/gre/geoip)[ RSS](/packages/gre-geoip/feed)WikiDiscussions master Synced today

READMEChangelog (10)DependenciesVersions (27)Used By (0)

Greip PHP Library
=================

[](#greip-php-library)

The official PHP library for Greip API

[Report Issue](https://github.com/Greipio/php/issues/new)· [Request Feature](https://github.com/Greipio/php/discussions/new?category=ideas)· [Greip Website](https://greip.io/)· [Documentation](https://docs.greip.io/)

[![Packagist](https://camo.githubusercontent.com/e9e18390dc52dd6ceb4cfb36ccd5b96e2d2ac0594f40e8188f2033143a90021a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d4342333833373f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d776869746526636f6c6f723d663238643161)](https://packagist.org/packages/gre/geoip)[![Github Repository](https://camo.githubusercontent.com/b03860692249c0a5d9ebad8d3ebd53664f28e281a43e74e5fabfa23e8c2fa285/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d4342333833373f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d776869746526636f6c6f723d626c61636b)](https://github.com/Greipio/php)

[![Packagist Version](https://camo.githubusercontent.com/24f7bde2bda0ad173855edbf41c1bea8d4ebad06dc29640b373d029a574edda9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772652f67656f69703f636f6c6f723d627269676874677265656e266c6162656c3d537461626c65266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/24f7bde2bda0ad173855edbf41c1bea8d4ebad06dc29640b373d029a574edda9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772652f67656f69703f636f6c6f723d627269676874677265656e266c6162656c3d537461626c65266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465) [![GitHub code size in bytes](https://camo.githubusercontent.com/64d00a101ddecc7e972f43894e86822075fc5699461e9905929484e41e8ec19c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f4772656970696f2f7068703f636f6c6f723d627269676874677265656e266c6162656c3d53697a65266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/64d00a101ddecc7e972f43894e86822075fc5699461e9905929484e41e8ec19c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f4772656970696f2f7068703f636f6c6f723d627269676874677265656e266c6162656c3d53697a65266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465) [![API Status](https://camo.githubusercontent.com/ada4aa8f4b99c4ee073675aa7aceaaa6369c0090a3acb205e06aee0f22d41769/68747470733a2f2f696d672e736869656c64732e696f2f776562736974653f646f776e5f636f6c6f723d6f72616e676526646f776e5f6d6573736167653d646f776e266c6162656c3d4150492532307374617475732675705f636f6c6f723d627269676874677265656e2675705f6d6573736167653d75702675726c3d687474707325334125324625324667726569706170692e636f6d)](https://camo.githubusercontent.com/ada4aa8f4b99c4ee073675aa7aceaaa6369c0090a3acb205e06aee0f22d41769/68747470733a2f2f696d672e736869656c64732e696f2f776562736974653f646f776e5f636f6c6f723d6f72616e676526646f776e5f6d6573736167653d646f776e266c6162656c3d4150492532307374617475732675705f636f6c6f723d627269676874677265656e2675705f6d6573736167653d75702675726c3d687474707325334125324625324667726569706170692e636f6d) [![License: Apache 2.0](https://camo.githubusercontent.com/5b60841bea9e11d9d0b0950d690c9bc554e06385634056a7d5d62a15d1a4eabe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4170616368655f322e302d626c75652e737667)](https://opensource.org/license/apache-2-0) [![Packagist PHP Version Support](https://camo.githubusercontent.com/0934b990e07846d64cc6729eac69828777148ccab20ede682b9be35956bd2859/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6772652f67656f69703f636f6c6f723d626c7565)](https://camo.githubusercontent.com/0934b990e07846d64cc6729eac69828777148ccab20ede682b9be35956bd2859/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6772652f67656f69703f636f6c6f723d626c7565)

---

Installation
------------

[](#installation)

```
composer require gre/geoip

```

Usage
-----

[](#usage)

Here's how you use the library:

### 1. IP Geolocation

[](#1-ip-geolocation)

Use this method to retrieve the information of a given IP address.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$GeoIP = new Greip\API\GeoIP();

// Setting the API Key
$config->setToken("");

// Sending the request and storing the output in a variable
$GeoIP_Response = $GeoIP->lookup("1.1.1.1");

// Printing the response
print_r($GeoIP_Response);
```

### 2. IP Threats

[](#2-ip-threats)

Use this method to retrieve threat intelligence information associated with a given IP address.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$GeoIP = new Greip\API\GeoIP();

// Setting the API Key
$config->setToken("");

// Sending the request and storing the output in a variable
$GeoIP_Response = $GeoIP->threats("1.1.1.1");

// Printing the response
print_r($GeoIP_Response);
```

### 3. ASN Lookup

[](#3-asn-lookup)

In this method, Greip will help you lookup any given AS Number and returning all data related to it, like: name, org (the organization name), country, domain, email, phone, totalIPs, list of all routes (v4 &amp; v6) related the given AS Number, etc.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$GeoIP = new Greip\API\GeoIP();

// Setting the API Key
$config->setToken("");

// Sending the request and storing the output in a variable
$ASN_Response = $GeoIP->asn("AS01");

// Printing the response
print_r($ASN_Response);
```

### 4. Country Lookup

[](#4-country-lookup)

This method can help you retrieve information of the given country.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$GeoIP = new Greip\API\GeoIP();

// Setting the API Key
$config->setToken("");

// Sending the request and storing the output in a variable
$Country_Response = $GeoIP->country("US", ["language", "timezone", "currency"]);

// Printing the response
print_r($Country_Response);
```

### 5. Email Validation

[](#5-email-validation)

This method provides an additional layer of validation for your system. While validating email syntax is important, it is not sufficient.

This method goes beyond syntax validation by checking the domain’s validity, the availability of the Mail Service, detecting Disposable Email (Temporary Emails), etc. By utilising this method, you can ensure a more thorough validation process for email addresses.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$Fraud = new Greip\API\Fraud();

// Setting the API Key
$config->setToken("");

// Sending the request and storing the output in a variable
$Email_Response = $Fraud->email("example@domain.com");

// Printing the response
print_r($Email_Response);
```

### 6. Phone Validation

[](#6-phone-validation)

This method can be used as an extra-layer of your system for validating phone numbers. It validates phone number syntax and valid-possibility.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$Fraud = new Greip\API\Fraud();

// Setting the API Key
$config->setToken("");

// Sending the request and storing the output in a variable
$Phone_Response = $Fraud->phone("000000000", "US");

// Printing the response
print_r($Phone_Response);
```

### 7. Profanity Detection

[](#7-profanity-detection)

This method can be used to detect abuse of your website/app. It’s a great way to know more about your user inputs and whether they contain profanity (bad words) or not before releasing them to the public.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$Fraud = new Greip\API\Fraud();

// Setting the API Key
$config->setToken("");

// Sending the request and storing the output in a variable
$Profanity_Response = $Fraud->profanity("This is a sample text", true, false);

// Printing the response
print_r($Profanity_Response);
```

### 8. Payment Fraud Prevention

[](#8-payment-fraud-prevention)

Prevent financial losses by deploying AI-Powered modules.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$Fraud = new Greip\API\Fraud();

// Setting the API Key
$config->setToken("");

// Declaring Transaction Data
$data = [
  "action" => "purchase",
  "website_domain" => "example.com",
  "merchant_id" => 21,
  "customer_id" => 1,
  "customer_ip" => "1.0.0.2",
  "customer_email" => "asdfasdf@gmasail.com",
  "customer_phone" => "32423434",
  "customer_country" => "US",
  "transaction_amount" => 100000,
  "transaction_currency" => "USD",
  "customer_useragent" => "Mozill almaden sdfwer",
];

// Sending the request and storing the output in a variable
$Payment_Response = $Fraud->payment($data);

// Printing the response
print_r($Payment_Response);
```

### 9. IBAN Validation

[](#9-iban-validation)

This method allows you to validate International Bank Account Numbers (IBANs) and retrieve additional information about the country associated with the IBAN.

```
include_once __DIR__ . "/vendor/autoload.php";

// Declaring the classes we need
$config = new Greip\API\Config();
$Fraud = new Greip\API\Fraud();

// Setting the API Key
$config->setToken("");

// Sending the request and storing the output in a variable
$IBAN_Response = $Fraud->iban("FO9264600123456789");

// Printing the response
print_r($IBAN_Response);
```

Options, Methods and More
-------------------------

[](#options-methods-and-more)

You can find the full guide of this package by visiting our [Documentation Page](https://docs.greip.io/).

Credits
-------

[](#credits)

- [Greip Team](https://greip.io/)
- [All Contributors](https://github.com/Greipio/php/graphs/contributors)

Repo Activity
-------------

[](#repo-activity)

[![Alt](https://camo.githubusercontent.com/41f0b2bc4cf9c227a82a7f5516184ef9da4ad081d0b6c90dc00dba1d3dc06592/68747470733a2f2f7265706f62656174732e6178696f6d2e636f2f6170692f656d6265642f613031346564363332353836383038623935363735623064666337613730343561643161633166632e737667 "Repobeats analytics image")](https://camo.githubusercontent.com/41f0b2bc4cf9c227a82a7f5516184ef9da4ad081d0b6c90dc00dba1d3dc06592/68747470733a2f2f7265706f62656174732e6178696f6d2e636f2f6170692f656d6265642f613031346564363332353836383038623935363735623064666337613730343561643161633166632e737667)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Recently: every ~2 days

Total

26

Last Release

840d ago

Major Versions

1.1.9 → 2.02023-02-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/211411?v=4)[@greweb](/maintainers/gre)[@gre](https://github.com/gre)

---

Top Contributors

[![gre-dev](https://avatars.githubusercontent.com/u/59331174?v=4)](https://github.com/gre-dev "gre-dev (44 commits)")

---

Tags

apiasn-lookupbin-lookupcountry-datacredit-card-fraudfraud-detectionfraud-preventiongelocationgeoipgeolocation-apiphpprofanity-detectionapigeoipprofanityAbuseIPlocationfraudemail-verificationphone verificationiban validationip intelligencebin lookupip reputation

### Embed Badge

![Health badge](/badges/gre-geoip/health.svg)

```
[![Health](https://phpackages.com/badges/gre-geoip/health.svg)](https://phpackages.com/packages/gre-geoip)
```

###  Alternatives

[ipgeolocation/ipgeolocation-php-sdk

Official PHP SDK for the IPGeolocation.io IP Location API with single and bulk lookup support.

414.8k](/packages/ipgeolocation-ipgeolocation-php-sdk)[fingerprint/fingerprint-pro-server-api-sdk

Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.

33274.4k1](/packages/fingerprint-fingerprint-pro-server-api-sdk)[ok/ipstack-client

A PHP wrapper for using Ipstack API

11396.0k](/packages/ok-ipstack-client)[fingerprint/server-sdk

Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.

323.6k](/packages/fingerprint-server-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
