Skip to main content

apiverve_airquality 1.2.2 copy "apiverve_airquality: ^1.2.2" to clipboard
apiverve_airquality: ^1.2.2 copied to clipboard

Air Quality is an air pollution API that reports particulate pollution levels and health recommendations for any city or zip code. Look up PM2.5 and PM10 concentrations to check current air conditions [...]

Air Quality API - Dart/Flutter Client #

Air Quality is an air pollution API that reports particulate pollution levels and health recommendations for any city or zip code. Look up PM2.5 and PM10 concentrations to check current air conditions; paid plans add ozone, toxic gases, and EPA index scores.

pub package License: MIT

This is the Dart/Flutter client for the Air Quality API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_airquality: ^1.2.2

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_airquality/apiverve_airquality.dart';

void main() async {
  final client = AirqualityClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'city': 'San Francisco'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response #

{
  "status": "ok",
  "error": null,
  "data": {
    "pm2_5": 16.75,
    "pm10": 18.85,
    "carbonMonoxide": 387.85,
    "ozone": 9,
    "nitrogenDioxide": 38.55,
    "sulfurdioxide": 5.95,
    "usEpaIndex": 2,
    "gbDefraIndex": 2,
    "recommendation": "The air quality in San Francisco is good. It is safe to go outside.",
    "city": "San Francisco"
  }
}

API Reference #

Authentication #

All requests require an API key. Get yours at apiverve.com.

License #

MIT License - see LICENSE for details.


Built with Dart for APIVerve

0
likes
130
points
163
downloads

Documentation

API reference

Publisher

verified publisherapiverve.com

Weekly Downloads

Air Quality is an air pollution API that reports particulate pollution levels and health recommendations for any city or zip code. Look up PM2.5 and PM10 concentrations to check current air conditions; paid plans add ozone, toxic gases, and EPA index scores.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_airquality