PHP Classes
elePHPant
Icontem

PHP GeoHelper API Client: Retrieve location lists using the Geohelper API

Recommend this page to a friend!
  Info   View files Documentation   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-05-02 (5 months ago) RSS 2.0 feedNot enough user ratingsTotal: 150 All time: 8,726 This week: 313Up
Version License PHP version Categories
geohelper-api-client 1.0.0BSD License5PHP 5, Web services, Geography
Description Author

This package can retrieve location lists using the Geohelper API.

It can send HTTP requests to the Geohelper API to retrieve several types of lists related with geographic locations like for countries list, country cities list, country regions lists and city streets list.

The class can also retrieve other locale dependent information related with phones, service locality and post codes.

Innovation Award
PHP Programming Innovation award nominee
May 2019
Number 9
Knowing details about the location in the world where each user is, it is a very important for many types of applications.

This package not only is able to determine the location of a user based on the IP address of his computer, but also other details like countries lists, country city lists and region lists where the users may be located.

Manuel Lemos
  Performance   Level  
Name: Dmitry Mamontov <contact>
Classes: 15 packages by
Country: Russian Federation Russian Federation
Age: 29
All time rank: 91733 in Russian Federation Russian Federation
Week rank: 121 Up7 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 6x

 

Details

Geohelper API PHP client

PHP-client for Geohelper API.

Use API documentation

Requirements

  • PHP 5.3 and above
  • PHP's cURL support

Install

1) Get composer

2) Run into your project directory:

composer require dmamontov/geohelper-api-client-php ~1.0.0

If you have not used composer before, include autoloader into your project.

require 'path/to/vendor/autoload.php';

Usage

Get countries

$client = new \Geohelper\ApiClient(
    'api_key'
);


try {
    $response = $client->countriesList();
} catch (\Geohelper\Exception\CurlException $e) {
    echo "Connection error: " . $e->getMessage();
}

if ($response->isSuccessful()) {
    $countries = isset($response['result']) ? $response['result'] : array();
    foreach ($countries as $country) {
        echo $country['name'];
    }
} else {
    echo sprintf(
        "Error: [HTTP-code %s] %s",
        $response->getStatusCode(),
        $response->getErrorMsg()
    );
}
  Files folder image Files  
File Role Description
Files folder imagelib (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  lib  
File Role Description
Files folder imageGeohelper (1 file, 3 directories)

  Files folder image Files  /  lib  /  Geohelper  
File Role Description
Files folder imageException (2 files)
Files folder imageHttp (1 file)
Files folder imageResponse (1 file)
  Plain text file ApiClient.php Class Class source

  Files folder image Files  /  lib  /  Geohelper  /  Exception  
File Role Description
  Plain text file CurlException.php Class Class source
  Plain text file InvalidJsonException.php Class Class source

  Files folder image Files  /  lib  /  Geohelper  /  Http  
File Role Description
  Plain text file Client.php Class Class source

  Files folder image Files  /  lib  /  Geohelper  /  Response  
File Role Description
  Plain text file ApiResponse.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:150
This week:0
All time:8,726
This week:313Up
User Comments (1)
bueno
3 months ago (ricardo salamanca)
70%StarStarStarStar