Built a petrol price tracker + next-day price predictor for Pakistan (OGRA data, full automation pipeline)

:snoo_smile: Startup | Freelance | Personal Finance

I've been building this solo for the past few months—sharing the technical side since this sub allows it.

**What it is:** petrolratetoday.pk — daily petrol/diesel prices for Pakistan, sourced directly from OGRA.

**Unique feature — Next-Day Price Prediction:**

Instead of just showing today's rate, I built a prediction model that forecasts tomorrow's petrol price *before* the official OGRA announcement, based on global crude trends, PKR/USD movement, and historical adjustment patterns. This is what sets it apart from every other rate-checker site in Pakistan.

**Other features:**

- **Price Composition breakdown** — shows exactly what you're paying for in a litre (base price, petroleum levy, custom duty, distributor/dealer margin, etc.) — most people have no idea how the price is actually built

- **Price History Chart** — visual trend of petrol/diesel prices over time, so users can track hikes/cuts historically

- **Fuel Cost Calculator** — enter your car's mileage + distance, get an estimated trip/monthly fuel cost

**Tech stack:**

- Scraper: Python + `curl_cffi`, hosted on Railway

- Had to fight OGRA's WAF — constant 403s until I switched to residential proxies + proper session/header handling

- Frontend: Next.js

- Automation: Make.com → Schedule → HTTP GET my API → APITemplate.io renders a branded price card → auto-posts to Facebook + Instagram

- WhatsApp Channel for instant price alerts

**Biggest technical challenge:**

OGRA's site actively blocks automated scraping. Rotating residential proxies + `curl_cffi`'s TLS fingerprint spoofing got me past the WAF reliably. Happy to share details if anyone's dealing with similar scraping/anti-bot issues.

Still chasing SEO indexing on a fresh Next.js domain — if anyone's cracked that, would love input.

🔗 https://petrolratetoday.pk

Posted Sep 10, 2026, 7:15 PM UTC

1025
Loading comments…