Skip to content

drupeshUnwired/locationiq-php-client

 
 

Repository files navigation

locationiq

LocationIQ provides flexible enterprise-grade location based solutions. We work with developers, startups and enterprises worldwide serving billions of requests everyday. This page provides an overview of the technical aspects of our API and will help you get started.

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.1
  • Package version: 1.0.1
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/location-iq/locationiq-php-client.git"
    }
  ],
  "require": {
    "location-iq/locationiq-php-client": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/locationiq/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: key
$config = LocationIq\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = LocationIq\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer');

$apiInstance = new LocationIq\Api\BalanceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->balance();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BalanceApi->balance: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://eu1.locationiq.com/v1

Class Method HTTP request Description
BalanceApi balance GET /balance.php
ReverseApi reverse GET /reverse.php Reverse Geocoding
SearchApi search GET /search.php Forward Geocoding

Documentation For Models

Documentation For Authorization

key

  • Type: API key
  • API key parameter name: key
  • Location: URL query string

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.1%
  • Shell 0.9%