Skip to content

wesleyzloza/comed-bills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComEd Electricity Bill Downloader

A Node.js library to bulk download utility bills from the ComEd web portal.

Down arrow colors matching branding of the Commonwealth Edison Company

Background

Utility companies often do not provide a way to bulk download bills/invoices. This library allows users to download the utility bills that have been issued by the ComEd (Commonwealth Edison Company) within the last 24 months. Unfortunately ComEd does not appear to provide a method of gathering utility beyond 24 months.

Usage

The ComEdBillDownloader class contains the following methods to for requesting and saving a bill from the Commonwealth Edison Company customer portal:

  • authenticate() - Authenticates and performs the necessary server operations to download bills.
  • tryBulkDownload() - Attempts to download all bills from the last 24 months.
import { sub } from 'date-fns';
import { ComEdBillDownloader } from 'comed-bills';

// Account details:
const ACCOUNT_NUMBER = '12349780000';
const USERNAME = 'JohnDoe';
const PASSWORD = 'FooBaBaz123';

// Download bills from the last 12 months:
const to = new Date();
const from = sub(to, { months: 12 });
const saveDirectory = import.meta.dirname;
const downloader = new ComEdBillDownloader();
await downloader.authenticate(USERNAME, PASSWORD);
await downloader.bulkDownload(ACCOUNT_NUMBER, from, to, saveDirectory);

System Requirements

  • Node v18+
  • x64 Architecture

License

MIT License

About

A Node.js library to bulk download utility bills from the ComEd (Commonwealth Edison Company).

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors