Fast and secure access from your computer or server to global air monitoring pollution service. Only a few lines of code are needed to begin getting data from a different places arround the word.
I wrote this library for monitoring air pollution in Telegram bots:
- For India (Delhi, Mumbai, Kolkata, etc.)
- For Uzbekistan (Tashkent, Samarkand, Bukhara, etc.)
How start sample console project.
- Register on iqair.com to create your account.
- Obtain an API Access Token by following these instruction.
- Configure the API Key in your
appsettings.jsonfile:
"IQAirV2Options": {
"ApiKey": "set you api key!",
- Set your location (Country, State and City) in the
appsettings.json
"MeasurementCityOptions": {
"Country": "India",
"State": "Delhi",
"City": "Delhi"
},
- Run the console application to see the live air quality data.
- Install the package via NuGet:
dotnet add package IQAir.Integration.Api
- Configure an API Key in your appsettings.json file:
"IQAirV2Options": {
"ApiKey": "set you api key!",
- Register the service in your
Program.csfile:
// Add the IQAir integration to your service collection
builder.Services.AddIQAirOpenApiIntegration(config);
-
🚀 Fast & Lightweight: Optimized for high-performance console applications and high-traffic Telegram bots.
-
💉 Dependency Injection Ready: Seamlessly integrates with .NET Host and IServiceCollection using the AddIQAirOpenApiIntegration extension.
-
🏗️ Strongly Typed Models: No more manual JSON parsing. Provides clean C# classes for Cities, States, and Air Quality Indexes (AQI).
-
⚡ Fully Asynchronous: Built from the ground up using async/await to ensure non-blocking I/O operations.
-
🌍 Global Coverage: Access real-time air quality and weather data for thousands of cities in India, Uzbekistan, and across the globe.
-
🛡️ Secure Configuration: Uses the modern IOptions pattern for safe API key management via appsettings.json or Environment Variables.
