
Building AQR: Turning Air Quality Data into Smarter Routes with AWS
Explore how AQR combines environmental APIs, alternative route planning, AI-powered insights, and AWS services to help people make more informed travel decisions based on estimated air-quality conditions.
Building AQR: Turning Air Quality Data into Smarter Routes with AWS
Introduction
Most navigation applications help us answer one question: How do we get to our destination as quickly as possible?
But there is another question worth asking: What environmental conditions might we encounter along the way?
Air pollution is an important part of everyday urban life. Children travelling to school, pedestrians walking through busy streets, and people with respiratory sensitivities may benefit from understanding the air-quality conditions associated with their journeys.
This inspired me to build AQR (Air Quality Routing), an intelligent navigation platform that brings environmental information into route planning.
Rather than displaying air-quality information in isolation, AQR aims to make that information useful by comparing alternative routes and helping users make more informed travel decisions.
The project was built for Environmental Hacks, with a focus on combining environmental data, route optimization, AI-powered insights, and AWS infrastructure into a working application.
The Problem: Navigation Beyond Travel Time
Traditional route planning focuses primarily on factors such as distance and estimated travel time. However, two alternative routes can have different environmental conditions.
AQR explores how available air-quality information can become another input into navigation.
The application is designed around three route preferences:
- Fastest: Prioritizes travel time.
- Balanced: Considers travel time alongside estimated air-quality conditions.
- Cleanest: Prioritizes lower estimated pollution exposure based on the available data.
These preferences give users a way to explore different trade-offs instead of relying on a single route recommendation.
Importantly, AQR does not claim that a route is completely safe or guarantees lower personal exposure. Its recommendations depend on the quality, coverage, and freshness of the underlying data.
Architecture: Connecting Environmental Data to Route Decisions
AQR combines several external APIs with an application layer and AWS services.
The application follows a simple pipeline:
- The user searches for a destination and selects a starting location.
- The application retrieves candidate routes.
- Environmental and weather data are retrieved for the relevant locations.
- The application evaluates available information and compares route alternatives.
- The interface presents route options and supporting environmental insights.
- AWS services support telemetry, incident storage, event processing, notifications, route-data storage, and operational monitoring.
The goal is to turn separate sources of information into a useful navigation experience.
Integrating the APIs
1. Air Quality Data — Open-Meteo
API:
https://air-quality-api.open-meteo.com/v1/air-quality Air-quality data is central to AQR. The application uses Open-Meteo to retrieve available environmental indicators, including AQI-related information and pollutants such as PM2.5, PM10, nitrogen dioxide, and ozone.
These values help the application present air-quality conditions and compare the environmental information associated with alternative routes.
Open-Meteo provides access to atmospheric data derived from the Copernicus Atmosphere Monitoring Service (CAMS). Its API can be used without an API key.
One important engineering consideration is spatial resolution. Atmospheric models do not necessarily represent street-level conditions, so the application must avoid presenting model-based estimates as direct measurements at every point along a road.
2. Weather Data — Open-Meteo Forecast API
API:
https://api.open-meteo.com/v1/forecast Weather conditions provide additional context for interpreting a journey. AQR uses the Open-Meteo Forecast API to retrieve available variables such as temperature, relative humidity, and wind speed.
This information complements the air-quality view and helps users understand the environmental conditions surrounding their travel.
Weather information should be treated as supporting context rather than proof that a particular route has better air quality.
3. Place Search and Geocoding — Photon
API:
https://photon.komoot.io/api/ A navigation application needs to translate human-readable places into usable geographic coordinates.
AQR uses Photon, a geocoding service built on OpenStreetMap data, for place search and location lookup. This allows users to search for destinations such as IIT Madras rather than manually entering latitude and longitude.
Geographic coordinates then provide the basis for requesting routes and retrieving location-dependent environmental information.
4. Route Navigation — Mapbox Directions with OSRM Fallback
AQR uses the Mapbox Directions API as its primary routing provider, with the OSRM public routing service available as a fallback when Mapbox is not configured.
Mapbox provides route directions and alternative paths, while OSRM provides an alternative route-computation option.
This integration is important because environmental comparisons require candidate routes to evaluate. Instead of assuming that the first route is the only option, AQR can compare alternatives using the information available to the application.
The routing provider and fallback behavior also make the application more flexible during development and testing.
5. AI Chatbot and Agent Intelligence — Groq
AQR integrates Groq Cloud to power its AI chat endpoint, using the configured model
qwen/qwen3.8-27b .The AI layer provides conversational assistance and environmental explanations. It is intended to help users interpret available information and understand route-related trade-offs.
The AI component complements the underlying APIs and route-comparison logic; it should not replace factual environmental data or invent pollutant measurements.
Why AWS Is Important to AQR
The AWS layer supports the application beyond its user interface. AQR integrates multiple AWS services for different operational responsibilities.
AWS Amplify — Frontend Hosting
AWS Amplify is used to host the frontend application, providing a deployment and hosting layer for the user-facing experience.
Amazon DynamoDB — Telemetry and Incident Data
AQR uses DynamoDB tables named
AQR_AgentTelemetry and AQR_Incidents .These tables support the storage of agent telemetry and incident-related records, helping the application maintain structured operational data.
Amazon EventBridge — Event-Driven Coordination
EventBridge is integrated as the application's event bus. It supports publishing and handling application events, including events associated with AQR tasks and environmental monitoring workflows.
An event-driven approach helps separate the production of an event from the components that respond to it.
Amazon SNS — Pollution Alerts
AQR integrates an SNS topic named
AQR_Pollution_Alerts for pollution-related alert workflows.SNS provides a notification mechanism that can distribute messages to configured subscribers. Actual delivery depends on the configured subscriptions and the application's alert-triggering logic.
Amazon S3 — Route Data Storage
Amazon S3 is used to store route-related data objects. This provides a durable storage location for route artifacts generated by the application.
Amazon CloudWatch — Monitoring and Logs
CloudWatch is integrated for application and infrastructure observability, including telemetry and operational metrics such as pipeline latency and error rates.
This makes it easier to inspect system behavior instead of evaluating the application solely by what appears on the frontend.
Together, these services give AQR a cloud infrastructure layer for storage, event coordination, notifications, and operational visibility.
Bringing Everything Together
Consider a user planning a journey to IIT Madras.
The user enters the destination and selects a starting location. AQR resolves the location, requests available route alternatives, and retrieves relevant environmental and weather information.
The application then compares the available routes against the user's selected preference.
If the user chooses Fastest, travel time takes priority. If the user chooses Balanced, the application considers travel time alongside available air-quality information. If the user chooses Cleanest, the application prioritizes lower estimated pollution exposure based on its implemented comparison logic.
The result is not simply an air-quality dashboard or a route displayed on a map. It is an attempt to connect environmental information with a practical decision that people make every day.
AWS services support the operational side of the system, while the external APIs provide the geographic, routing, weather, and air-quality information that drives the experience.
What I Learned
AQR reinforced an important engineering lesson: collecting data is only the beginning.
The real challenge is connecting independent services into a coherent workflow, making the information understandable, and ensuring that recommendations reflect the data actually available.
Combining external APIs with AWS infrastructure also demonstrates how cloud services can support a practical application beyond hosting a frontend.
For me, the most interesting part of AQR is the opportunity to transform environmental information from something people simply observe into something they can consider when making everyday decisions.
Conclusion
Our goal with AQR is simple: not just to display AQI data on a dashboard, but to use it to help people make more informed route choices, especially when environmental conditions matter.
By connecting environmental APIs, route alternatives, AI-powered assistance, and AWS services, AQR explores a more environmentally aware approach to navigation.
There is still room to improve data resolution, validation, and route-exposure estimation. But the project establishes a foundation for exploring how environmental intelligence can become part of everyday mobility.
AQR — Air Quality Routing. Turning air-quality data into smarter journeys.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article