PHPackages                             ok/ipstack-client - 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. ok/ipstack-client

ActiveLibrary[API Development](/categories/api)

ok/ipstack-client
=================

A PHP wrapper for using Ipstack API

2.1(4y ago)10384.3k↓19.4%MITPHPPHP &gt;=7.4

Since Jun 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/GitHubHubus/ipstack-client)[ Packagist](https://packagist.org/packages/ok/ipstack-client)[ Docs](https://github.com/GitHubHubus/ipstack-client)[ RSS](/packages/ok-ipstack-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/e1d8749c12f40f9c312e7ddaf9d3efc1cad12a6854cd3b9b1c703f6955015fa6/68747470733a2f2f706f7365722e707567782e6f72672f6f6b2f6970737461636b2d636c69656e742f76657273696f6e)](https://packagist.org/packages/ok/ipstack-client)[![Total Downloads](https://camo.githubusercontent.com/a189dd554ae481cc600eb1cde200c094ab65b28aa320920e86471c008409884a/68747470733a2f2f706f7365722e707567782e6f72672f6f6b2f6970737461636b2d636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/ok/ipstack-client)[![License](https://camo.githubusercontent.com/c3721414cdbb7cb632a2fdee28ff2d4be1aee428d9adcae9722efb3a77ad531e/68747470733a2f2f706f7365722e707567782e6f72672f6f6b2f6970737461636b2d636c69656e742f6c6963656e7365)](https://packagist.org/packages/ok/ipstack-client)

ipstack-client
==============

[](#ipstack-client)

A PHP wrapper for using Ipstack [API](https://ipstack.com/)

#### Install via `composer`:

[](#install-via-composer)

```
composer require ok/ipstack-client
```

#### Basic usage

[](#basic-usage)

Get data as the [Location](https://github.com/GitHubHubus/ipstack-client/blob/master/src/OK/Ipstack/Entity/Location.php) object:

```
$client = new OK\Ipstack\Client('api_key');
$location = $client->get('134.201.250.155', false);
var_dump($location);
```

result:

```
class OK\Ipstack\Entity\Location#3 (12) {
  protected $city =>
  string(11) "Los Angeles"
  protected $continentCode =>
  string(2) "NA"
  protected $continentName =>
  string(13) "North America"
  protected $countryCode =>
  string(2) "US"
  protected $countryName =>
  string(13) "United States"
  protected $regionCode =>
  string(2) "CA"
  protected $regionName =>
  string(10) "California"
  protected $zip =>
  string(5) "90026"
  protected $latitude =>
  double(34.0766)
  protected $longitude =>
  double(-118.2646)
  protected $ip =>
  string(15) "134.201.250.155"
  protected $valid =>
  bool(true)
}
```

Get data as a simple array:

```
$client = new OK\Ipstack\Client('api_key');
$location = $client->get('134.201.250.155');
var_dump($location);
```

result:

```
array(13) {
  'ip' =>
  string(15) "134.201.250.155"
  'type' =>
  string(4) "ipv4"
  'continent_code' =>
  string(2) "NA"
  'continent_name' =>
  string(13) "North America"
  'country_code' =>
  string(2) "US"
  'country_name' =>
  string(13) "United States"
  'region_code' =>
  string(2) "CA"
  'region_name' =>
  string(10) "California"
  'city' =>
  string(11) "Los Angeles"
  'zip' =>
  string(5) "90026"
  'latitude' =>
  string(7) "34.0766"
  'longitude' =>
  string(9) "-118.2646"
  'location' =>
  array(8) {
    'geoname_id' =>
    string(7) "5368361"
    'capital' =>
    string(15) "Washington D.C."
    'languages' =>
    array(3) {
      'code' =>
      string(2) "en"
      'name' =>
      string(7) "English"
      'native' =>
      string(7) "English"
    }
    'country_flag' =>
    string(38) "http://assets.ipstack.com/flags/us.svg"
    'country_flag_emoji' =>
    string(8) "🇺🇸"
    'country_flag_emoji_unicode' =>
    string(15) "U+1F1FA U+1F1F8"
    'calling_code' =>
    string(1) "1"
    'is_eu' =>
    array(0) {
    }
  }
}
```

Information
-----------

[](#information)

#### Modifiable output params

[](#modifiable-output-params)

Available [params](https://github.com/GitHubHubus/ipstack-client/blob/master/src/OK/Ipstack/Entity/Params/IpstackParams.php) for getting custom result

For example:

```
$client = new OK\Ipstack\Client('api_key');
$client->getParams()->addField("calling_code");
```

#### Data providers

[](#data-providers)

Now, here are available several providers:

- [TYPE\_IPSTACK](https://ipstack.com/)
- [TYPE\_IPAPI](https://ipapi.com/)

You can change provider by pass one of type above as second argument in constructor

For example:

```
$client = new OK\Ipstack\Client('api_key', OK\Ipstack\Provider\ProviderFactory::TYPE_IPAPI);
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

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 ~247 days

Recently: every ~308 days

Total

6

Last Release

1643d ago

Major Versions

1.3 → 2.02021-11-10

PHP version history (2 changes)1.0PHP &gt;=7.0

2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/30c891365dc8fb30fbe087883fddaa4163dfcbb7fd34b2e8f1c9c388d013fdb3?d=identicon)[GitHubHubus](/maintainers/GitHubHubus)

---

Top Contributors

[![GitHubHubus](https://avatars.githubusercontent.com/u/11797167?v=4)](https://github.com/GitHubHubus "GitHubHubus (25 commits)")

---

Tags

phpapiclientIPgeocodeipstack

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ok-ipstack-client/health.svg)

```
[![Health](https://phpackages.com/badges/ok-ipstack-client/health.svg)](https://phpackages.com/packages/ok-ipstack-client)
```

###  Alternatives

[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3633.0M18](/packages/kunalvarma05-dropbox-php-sdk)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[google-gemini-php/symfony

Symfony Bundle for Gemini

149.4k1](/packages/google-gemini-php-symfony)[sima-land/api-php-client

Client library for Simaland APIs

311.5k](/packages/sima-land-api-php-client)

PHPackages © 2026

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