PHPackages                             abstractapi/php-ip-geolocation - 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. abstractapi/php-ip-geolocation

ActiveLibrary[API Development](/categories/api)

abstractapi/php-ip-geolocation
==============================

AbstractIpGeolocation - Wrapper to quickly start using the powerful AbstractAPI's IP geolocation service in your projects.

1.0.0(5y ago)01.4k↓50%MITPHPPHP &gt;=5.6

Since Apr 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/abstractapi/php-ip-geolocation)[ Packagist](https://packagist.org/packages/abstractapi/php-ip-geolocation)[ Docs](https://github.com/abstractapi/php-ip-geolocation)[ RSS](/packages/abstractapi-php-ip-geolocation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

AbstractAPI php-ip-geolocation library
======================================

[](#abstractapi-php-ip-geolocation-library)

Integrate the powerful [IP Geolocation API from Abstract](https://www.abstractapi.com/ip-geolocation-api) in your PHP project in a few lines of code.

Abstract's IP Geolocation API is a fast, lightweight, modern, and RESTful JSON API allowing you to look up the location, timezone, country details, and more of an IPv4 or IPv6 address.

It's very simple to use: you only need to submit your API key and an IP address, and the API will respond with an assessment of its geographical location, as well as additional details like the timezone, if it's a VPN address, and more.

Validating and verifying IP addresses is a critical step to reducing the chances of low-quality data and fraudulent or risky users in your website or application.

Documentation
=============

[](#documentation)

Supported PHP Versions
----------------------

[](#supported-php-versions)

This library supports the **PHP version 5.6** and higher.

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

[](#installation)

You can install **php-ip-geolocation** via composer or by downloading the source.

### Via Composer:

[](#via-composer)

**php-ip-geolocation** is available on Packagist as the [`abstractapi/php-ip-geolocation`](https://packagist.org/packages/abstractapi/php-ip-geolocation) package:

```
composer require abstractapi/php-ip-geolocation
```

API key
-------

[](#api-key)

Get your API key for free and without hassle from the [Abstact website](https://app.abstractapi.com/users/signup?target=/api/ip-geolocation/pricing/select).

Quickstart
----------

[](#quickstart)

### Geolocation from an IP Address

[](#geolocation-from-an-ip-address)

```
// Get a Geolocation from an IP Address Abstract's IP Geolocation API and PHP
