Node.js scripts for scraping and analyzing grocery store receipts.
Currently only supports parsing of digital receipts from one of the most popular chains in Bulgaria - Lidl.
- Node.js (version 22 or higher)
- OpenAI API key
- Clone the repository:
git clone https://github.com/todorgrigorov/receipt-scraper.git
cd receipt-scraper- Install dependencies:
npm install- Create a
.envfile in the root directory with your OpenAI API key:
LIDL_COOKIE=auth_cookie_for_fetching_the_receipts
OPENAI_API_KEY=your_api_key_here
OPENAI_MODEL=your_model_name_here
The application consists of three main scripts.
Each script processes the output from the previous one, storing results in the src/lidl/out directory.
- Fetch receipt IDs:
node src/lidl/fetch-receipt-ids.js- Fetch receipt contents:
node src/lidl/fetch-receipt-contents.js- Turn raw receipts data into JSON structured format using an LLM (OpenAI):
node src/lidl/receipt-analyzer.js- Concat individual receipt JSONs
./concat.sh- Analyze!
python query.py