/airnow-scraper

A simple scraper for downloading air quality data of US embassies and consulates from AirNow Department of State (AirNow DOS) in bulk.

Primary LanguageTypeScriptMIT LicenseMIT

airnow-scraper

Overview

A simple scraper for downloading air quality data of US embassies and consulates from AirNow Department of State (AirNow DOS) in bulk.

Structure

  • dist/ - compiled JS
  • output/ - output folder, store downloaded data either in CSV (historical), or in JSON (current) format.

How to Use

Requires node.js 16 and TypeScript.

yarn start {current|historical}

Currently, fetching data from both current and historical endpoints are supported. You must provide either one of them when running the command.

current will get the data from this API endpoint.

historical will get the data from this API endpoint.

Alternatively, you can build it into a docker image and create a container with mounted volume. Make sure the folder to be binded (source) exists.

docker build . -t airnow-scraper && \
docker run --rm --mount type=bind,source="$(pwd)"/output,target=/app/output airnow-scraper {current|historical}