PHP Classes


Recommend this page to a friend!
  Classes of Dmitry Mamontov  >  PHP GeoHelper API Client  >  >  Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP GeoHelper API Client
Retrieve location lists using the Geohelper API
Author: By
Last change:
Date: 3 years ago
Size: 1,147 bytes


Class file image Download

Geohelper API PHP client

PHP-client for Geohelper API.

Use API documentation


  • PHP 5.3 and above
  • PHP's cURL support


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';


Get countries

$client = new \Geohelper\ApiClient(

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",
For more information send a message to info at phpclasses dot org.