Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/avantar/luft

Airly API client
https://github.com/avantar/luft

airly airly-api php php7

Last synced: 24 days ago
JSON representation

Airly API client

Awesome Lists containing this project

README

        

# luft
Airly PHP API client.

![Packagist Version](https://img.shields.io/packagist/v/avantar/luft)
![](https://github.com/avantar/luft/workflows/build/badge.svg)
[![codecov](https://codecov.io/gh/AvantaR/luft/branch/master/graph/badge.svg)](https://codecov.io/gh/AvantaR/luft)
[![Maintainability](https://api.codeclimate.com/v1/badges/d9e734016ed9ffe9c3b3/maintainability)](https://codeclimate.com/github/AvantaR/luft/maintainability)

## How to use

#### Create new instance of Luft library:

To use Luft library You need to create new instance of Client class and pass API key in its constructor.
```
$luft = new Client($apiKey);
```
```$apiKey``` variable is your private api key provided by Airly (https://developer.airly.eu/api).

#### Changing language
You can change default language of API responses. Airly API currently supports only two languages – English (en - and it's default option) and Polish (pl). To change language use ```setLanguage()``` method.

```
$luft->setLanguage('pl');
```

#### Coordinates
All coordinates used in Airly API **MUST** be accorded to **WGS 84 standard**.

#### Available methods

**getInstallationsNearest** – gets installations available in given range from selected point.

Required params:
* float $latitude
* float $longitude

Optional params
* float $maxDistanceKM
* int $maxResults

```
getInstallationsNearest(float $latitude, float $longitude [,float $maxDistanceKM, int $maxResults]): array
```
It should return array of ```Installation``` objects.

### Available objects

#### Installation
Available methods:
* getId(): int
* getLocation(): Coordinates
* getAddress(): Address
* getElevation(): float
* getAirly(): boolean
* getSponsor(): Sponsor