Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/avantar/luft
- Owner: AvantaR
- License: mit
- Created: 2019-11-18T20:44:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-22T22:11:25.000Z (almost 4 years ago)
- Last Synced: 2024-10-01T18:10:06.898Z (about 1 month ago)
- Topics: airly, airly-api, php, php7
- Language: PHP
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 $longitudeOptional 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