This API, built with the NestJS framework, allows automated checking of Carrefour gift card balances. It uses Puppeteer to scrape balance information directly from the official Carrefour website.
- β Gift card balance verification
- β Card validity date checking
- β Debug mode for troubleshooting
- β Configurable retry attempts and timeouts (Exponential Backoff)
- β Interactive API documentation via Swagger
- Node.js (v16 or higher)
- npm or yarn
- Chromium (automatically installed with Puppeteer)
# Clone the repository
git clone https://github.com/your-username/api-carrefour-giftcard-checker.git
cd api-carrefour-giftcard-checker
# Install dependencies
npm install
# Development mode
npm run start
# Watch mode
npm run start:dev
# Production mode
npm run start:prod
The API will be accessible at: http://localhost:3000
Swagger Documentation: http://localhost:3000/api
# Unit tests
npm run test
# End-to-end tests
npm run test:e2e
# Test coverage
npm run test:cov
# Build the image
docker build -t carrefour-giftcard-api .
# Run the container
docker run -p 3000:3000 carrefour-giftcard-api
curl -X POST http://localhost:3000/card-balance \
-H 'Content-Type: application/json' \
-d '{
"cardNumber": "50320004304585671840123",
"pin": "3301"
}'
{
"balance": "25.00 β¬",
"validityDate": "31/12/2025"
}
src/
βββ card-balance/ # Gift card verification module
β βββ dto/ # Data Transfer Objects
β βββ models/ # Data models
β βββ card-balance.controller.ts
β βββ card-balance.service.ts
βββ core/ # Core functionality
β βββ puppeteer/ # Puppeteer scraping service
βββ shared/ # Shared resources
βββ app.module.ts # Main application module
This project is licensed under the MIT License.