Air Quality & Environmental Data Feeds avatar

Air Quality & Environmental Data Feeds

Pricing

from $2.00 / 1,000 result scrapes

Go to Apify Store
Air Quality & Environmental Data Feeds

Air Quality & Environmental Data Feeds

Fetches real-time air quality data for cities worldwide using Open-Meteo. Returns location, US AQI, PM2.5 levels, measurement time, and scrape timestamp.

Pricing

from $2.00 / 1,000 result scrapes

Rating

0.0

(0)

Developer

Data Pilot

Data Pilot

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Categories

Share

๐ŸŒซ๏ธ Air Quality & Environmental Data Feeds is a powerful Apify Actor designed to discover, track, and collect real-time Air Quality & Environmental Data directly from the Open-Meteo geocoding and air-quality APIs. This tool provides comprehensive Air Quality & Environmental Data intelligence including station location, US Air Quality Index (AQI), and PM2.5 concentration for any city or keyword search. Whether you're building an environmental dashboard, tracking pollution trends, or conducting public-health research, the Air Quality & Environmental Data Feeds actor delivers actionable Air Quality & Environmental Data insights efficiently.

With direct Open-Meteo API integration, single-batch multi-location queries, automatic geocoding resolution, and reliable Apify Dataset delivery, the Air Quality & Environmental Data Feeds actor ensures comprehensive Air Quality & Environmental Data coverage across any matching location worldwide. It focuses on key Air Quality & Environmental Data signals including AQI and PM2.5, making it an essential tool for environmental research and public-health intelligence.


๐Ÿ“‹ Table of Contents


๐Ÿ”ฅ Features

  • Open-Meteo API Integration โ€“ Direct, key-less integration with Open-Meteo's geocoding and air-quality endpoints for accurate Air Quality & Environmental Data.
  • Automatic Geocoding Resolution โ€“ Converts any city name or keyword into matching coordinates before fetching Air Quality & Environmental Data.
  • Single-Batch Multi-Location Queries โ€“ Combines all matched locations into one air-quality API request for maximum efficiency.
  • Ultra-Fast Batch Mode โ€“ Retrieves Air Quality & Environmental Data for dozens of locations in just two total API calls.
  • US AQI & PM2.5 Metrics โ€“ Captures both the standardized US Air Quality Index and raw PM2.5 particulate concentration.
  • Configurable Result Cap โ€“ Control how many matching locations to include via maxResults.
  • Proxy Fallback Handling โ€“ Automatically retries without a proxy if a proxied request fails.
  • Optional Residential Proxy Support โ€“ Apify residential proxy available for reliable Air Quality & Environmental Data access when needed.
  • Real-Time Dataset Push โ€“ Pushes all harvested Air Quality & Environmental Data records to Apify Dataset in a single batch.
  • Detailed Logging โ€“ Comprehensive progress logging for every stage of the Air Quality & Environmental Data run.
  • Graceful Error Handling โ€“ Logs a clear warning and exits cleanly if no locations or measurements are found.

๐Ÿ“Š Data Source

Open-Meteo Geocoding & Air Quality APIs

  • Authority: Open-Meteo, a free and open-source weather and environmental data provider
  • Endpoints: geocoding-api.open-meteo.com/v1/search and air-quality-api.open-meteo.com/v1/air-quality
  • Coverage: Any city, town, or named location worldwide matching the search keyword
  • Data: US AQI, PM2.5 concentration, and station location details
  • Access: Public, key-less JSON APIs
  • Update Frequency: Reflects near-real-time Air Quality & Environmental Data at time of run

โš™๏ธ How It Works

The Air Quality & Environmental Data Feeds actor accepts a city name or keyword and first queries Open-Meteo's geocoding API to resolve it into a list of matching locations with coordinates. All matched coordinates are then combined into a single batched request to the air-quality API, retrieving current US AQI and PM2.5 readings for every location at once โ€” keeping the entire run to just two API calls regardless of how many locations are matched. Each result is paired back to its originating location and normalized into a clean Air Quality & Environmental Data record, then pushed to the Apify Dataset in one batch.

Key Processing Steps:

  1. Input Parsing โ€“ Accept a city name or keyword and a maximum result count
  2. Proxy Setup โ€“ Configure Apify residential proxy if enabled, with automatic no-proxy fallback
  3. Session Init โ€“ Create a Chrome-impersonated HTTP session for reliable API access
  4. Geocoding Lookup โ€“ Resolve the keyword into matching locations and coordinates
  5. Result Capping โ€“ Limit the matched locations to maxResults
  6. Batch Coordinate Assembly โ€“ Combine all latitudes and longitudes into one comma-separated query
  7. Air Quality Query โ€“ Fetch current AQI and PM2.5 for all locations in a single request
  8. Result Pairing โ€“ Match each air-quality result back to its originating location
  9. Record Normalization โ€“ Build a clean Air Quality & Environmental Data record per station
  10. Dataset Push โ€“ Push all harvested records to the Dataset in a single batch
  11. Summary Logging โ€“ Report the total number of records processed

Key Benefits:

  • Pull Air Quality & Environmental Data for any city or region without manual lookups
  • Retrieve dozens of locations' readings in just two total API calls
  • Monitor pollution levels and air quality trends across multiple cities at once
  • Feed environmental dashboards, public-health tools, or research pipelines
  • Automate recurring Air Quality & Environmental Data checks as conditions change

๐Ÿ“ฅ Input

The Actor accepts the following input parameters:

FieldTypeDefaultDescription
cityOrKeywordstring"London"City name or keyword to search for matching locations.
maxResultsinteger40Maximum number of matched locations to fetch Air Quality & Environmental Data for.
proxyConfigurationobject{} (proxy disabled by default)Apify Proxy configuration; set useApifyProxy: true to enable.

Example Input:

{
"cityOrKeyword": "Springfield",
"maxResults": 25
}

Search a Single Well-Known City:

{
"cityOrKeyword": "Paris",
"maxResults": 10
}

Search with Proxy Enabled:

{
"cityOrKeyword": "Los Angeles",
"maxResults": 15,
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

๐Ÿ“ค Output

The Actor pushes Air Quality & Environmental Data records with the following structure:

FieldTypeDescription
portalstringAlways "Environmental Portals"
stationstringLocation name, formatted as "City, Region, Country"
aqinumber/stringCurrent US Air Quality Index value, or "-" if unavailable
pm25number/stringCurrent PM2.5 concentration, or "-" if unavailable
datestringTimestamp of the measurement, as reported by Open-Meteo
scraped_atstringISO 8601 timestamp of when the record was scraped

Example Air Quality & Environmental Data Record:

{
"portal": "Environmental Portals",
"station": "Springfield, Illinois, United States",
"aqi": 42,
"pm25": 9.8,
"date": "2026-08-17 09:00",
"scraped_at": "2026-08-17T09:00:00.000Z"
}

๐Ÿงฐ Technical Stack

  • APIs: Open-Meteo Geocoding API and Open-Meteo Air Quality API (JSON format)
  • HTTP Client: curl_cffi with Chrome TLS fingerprint impersonation for reliable Air Quality & Environmental Data access
  • Batching: Single combined multi-coordinate request for all matched locations
  • Date Handling: datetime with timezone-aware UTC timestamps
  • Async: asyncio with executor-run blocking requests for non-blocking API calls
  • Proxy: Optional Apify Proxy with automatic no-proxy fallback on failure
  • Logging: Apify Actor logging system
  • Platform: Apify Actor serverless environment

๐Ÿ“Š Data Fields Explained

Location

  • station: The resolved location name, combining city, region, and country
  • portal: A fixed label identifying the data category as environmental

Measurements

  • aqi: The current US Air Quality Index โ€” higher values indicate worse air quality
  • pm25: The current fine particulate matter (PM2.5) concentration

Timing

  • date: When the underlying measurement was recorded
  • scraped_at: When this Air Quality & Environmental Data record was collected

๐ŸŽฏ Use Cases

  • Public Health Monitoring โ€“ Track air quality trends across cities relevant to health advisories
  • Environmental Research โ€“ Study pollution patterns and PM2.5 levels at scale
  • Travel Planning โ€“ Check air quality conditions before visiting or relocating to a city
  • Smart City Dashboards โ€“ Feed live Air Quality & Environmental Data into municipal monitoring tools
  • Academic Studies โ€“ Build datasets for climate, health, or urban-planning research
  • Journalism โ€“ Source authoritative air-quality figures for environmental reporting
  • Real Estate Research โ€“ Cross-reference neighborhood air quality with property value or desirability
  • Personal Health Tracking โ€“ Monitor conditions in your own city or frequently visited locations

๐Ÿš€ Quick Start

1. Prepare Input

Go to Apify Console and enter:

{
"cityOrKeyword": "Chicago",
"maxResults": 20
}

2. Run the Actor

Click Start. The Actor will:

  • Resolve the city or keyword into matching locations via geocoding
  • Batch-query air quality for all matched locations in one request
  • Normalize AQI and PM2.5 readings into clean records
  • Push all results to the Dataset in a single batch

3. Monitor Progress

Console shows:

โšก Fetching air quality for 'Chicago' in ultra-fast batch mode...
โœ… Successfully harvested 20 records in one single batch!
๐ŸŽ‰ Complete! Processed 20 records.

4. View & Download Results

  • Results Tab: All Air Quality & Environmental Data records
  • Export: JSON, CSV, Excel, or HTML
  • Filter: By AQI level, PM2.5 value, or station
  • API Access: Available via the Apify API

โš™๏ธ Configuration

Single city, default result cap:

{
"cityOrKeyword": "Berlin"
}

Broader search with more matches:

{
"cityOrKeyword": "Springfield",
"maxResults": 40
}

With proxy enabled for reliability:

{
"cityOrKeyword": "Delhi",
"maxResults": 10,
"proxyConfiguration": {"useApifyProxy": true}
}

๐Ÿ“ˆ Performance

Processing Speed

  • Just two total API calls per run โ€” one geocoding lookup, one batched air-quality query
  • No per-location delay needed, since all locations are fetched together
  • Scales efficiently even with dozens of matched locations in a single request

Resource Usage

  • Memory: Low, since only two lightweight JSON responses are processed
  • Network: Two requests total per run, regardless of maxResults
  • Proxy: Optional, with automatic fallback to a direct connection on failure

โš ๏ธ Important Notes

  • Fair Use: Respects Open-Meteo's public, key-less API endpoints
  • Public Data Only: Retrieves only publicly available Air Quality & Environmental Data
  • Legal: Not medical, public-health, or legal advice โ€” consult official environmental agencies for health-related decisions

Data Quality

  • Freshness: Reflects Open-Meteo's near-real-time measurements at time of run
  • Completeness: Some locations may return "-" for AQI or PM2.5 if no sensor data is currently available
  • Accuracy: Sourced directly from Open-Meteo's public air-quality models and monitoring network
  • Verification: Cross-check high-stakes figures against official government air-quality monitors

Best Practices

  • Use specific, well-known city names for the most reliable geocoding matches
  • Increase maxResults to capture more nearby stations or ambiguous city name matches
  • Enable the proxy only if you experience rate limiting or connectivity issues
  • Re-run periodically to track changing Air Quality & Environmental Data throughout the day
  • Cross-reference results with local air-quality authorities for health-sensitive decisions

Terms of Use:

  • Use for legitimate research, monitoring, and informational purposes
  • Respect Open-Meteo's API terms of use
  • Attribute Open-Meteo as the original data source where required
  • Use data responsibly

Disclaimer: Air Quality & Environmental Data Feeds is provided as-is for research and informational purposes. Users are responsible for compliance with Open-Meteo's terms of use. This is not medical, public-health, or legal advice โ€” always consult official environmental agencies for health-related decisions.


โš–๏ธ Air Quality & Environmental Data Excellence

This Actor is optimized for Air Quality & Environmental Data research with:

  • โœ… Automatic geocoding-to-coordinates resolution
  • โœ… Single-batch multi-location queries for maximum speed
  • โœ… US AQI and PM2.5 metrics in one clean record
  • โœ… Proxy fallback for reliable access
  • โœ… Real-time, single-batch Dataset push
  • โœ… Production-ready code