Airly Unofficial Java API wrapper for API Documentation
Airly API is compatible with Airly's API v2.
With Gradle:
dependencies {
compile 'com.github.ihmc:airly-api:v0.4-alpha'
}
You can create an Airly client using the AirlyClientBuilder
:
AirlyAPI airly = new AirlyServiceBuilder(apiKey);
This will create an instance of AirlyAPI
:
public interface AirlyAPI {
// Installations
Flowable<Installation> getInstallation(int installationId);
Flowable<List<Installation>> getNearestInstallations(double latitude,
double longitude,
double maxDistanceKm,
int maxResults);
// Measurements
Flowable<Measurement> getMeasurements(int installationId);
Flowable<Measurement> getNearestMeasurements(double latitude,
double longitude,
double maxDistanceKm);
Flowable<Measurement> getInterpolatedMeasurements(double latitude,
double longitude);
}
AirlyAPIExtensions
provides methods to retrieve installations and measurements in an area described by the South-West and North-East corners of a rectangular bounding box. These may come in handy to users of Airly API v1.
Airly API access is rate-limited. Default rate limits per apikey are 1000 API requests per day and 50 API requests per minute. AirlyServiceBuilder does not enforce any limit by default, it can be set as such:
AirlyAPI airly = new AirlyClientBuilder(apiKey)
.setRequestLimit(50, TimeUnit.MINUTES); // Enforce the 50 API requests per minute limit
Look at AirlyRxApp.kt