jason06's avatar

Bill Fetching Website

Hey There!

I want to create a website that will fetch data from other websites' databases and display it on my website. When a user visits my website and enters their unique reference number to check their electricity bills according to their reference number, my website scrapes data from the original website and shows it on my website. Due to my lack of experience with Laravel, I do not know how to do that. This same scenario has been implemented in PHP using cURL, but I'm not sure how it will be implemented in Laravel.

If there is anyone who can assist me in completing this task, please let me know.

Thanks!

0 likes
17 replies
Sinnbeck's avatar

Why does it need to scrape the data? Don't you run the second website and isn't there an api?

jason06's avatar

@Tray2 Why my project dubious to you? Are there any problems with my question or do I violate the forum's rules?

Tray2's avatar

@jason06 Because it might just violate a whole bunch of contracted rules that the company you are mining the data from, and it might also be illegal,

jason06's avatar

@Tray2 Oh come on dude! It's just a simple final year project task.

Tray2's avatar

@jason06 I don't think the company whose data you are using will care. Without a written permission from them, you might be heading up shit creek, and no one here will want to be in any way involved in such.

jlrdw's avatar

What about utility customers who does not want their data on your site. Many are happy I'm sure logging in directly to the utility company.

jason06's avatar

@jlrdw A user wants a simple, clean user interface that the original website does not have, so this idea clicked in our heads to solve the user's problem of bad UI and help them get their electricity bills without hesitation.

In addition, there is another website that does the same thing, but with another electricity company

Snapey's avatar

This same scenario has been implemented in PHP using cURL, but I'm not sure how it will be implemented in Laravel.

pretty much the same

I hope you are holding users credentials encrypted?

Its not a service I would personally use since i would not share one sites password with another, but that's just me. Maybe your customers are more naive

zahid0046's avatar

Thats true here many websites using the same things some are using iframe like this and some are using scrapping techniques and also you can use api from website to use it the one which is using iframe for Sepco online bill is

Snapey's avatar

@zahid0046 API exists for a reason. They are created so that consumers can be assured that the API will be stable at a specific version. Scrape pages and you are on your own. Wake up one day to a stream of annoyed customers because the target website changed the layout and basically you are on your own and your service is broken until you can reverse engineer the new layout.

oliviacrter's avatar

If you’re planning to fetch electricity bill data by reference number, one important thing to keep in mind is legal access. Scraping data directly from official utility websites without permission can violate their terms. A safer and more practical approach is to build a helper platform that guides users to check their bills online using publicly accessible methods, without storing or scraping private data. For example, I’ve seen similar implementations where users simply enter their reference number and the system redirects or helps them retrieve bill details in a user-friendly way. One such implementation is available here: fescoebillcheck.pk. From a Laravel perspective, you can: Use Laravel HTTP client (Guzzle) instead of raw cURL Validate and sanitize reference numbers Avoid storing sensitive customer data Focus on UX, caching, and performance rather than scraping databases This approach keeps things scalable, legal, and much easier to maintain in Laravel.

billwala's avatar

Adding to what's been said above—the scraping-vs-official-access distinction really matters here, both legally and practically.

Most Pakistani DISCOs (LESCO, MEPCO, FESCO, etc.) don't publish a public API, but several of them expose a lightweight bill-lookup endpoint that's intended for online bill retrieval. That's very different from logging into a customer portal and scraping authenticated content.

The safer approach is to:

  • Don't ask users for their utility account credentials. A reference number or customer ID printed on the bill is usually sufficient.
  • Either embed the official bill-check page where appropriate or interact with the same lightweight endpoint used by the official bill-check interface, rather than scraping authenticated pages.
  • Cache responses sensibly since bills typically update once per billing cycle.
  • Avoid storing bill data or reference numbers longer than necessary to complete the request.

If you're building this in Laravel, using the Http:: client (Guzzle-based), validating reference numbers with Form Requests for each DISCO, and adding a queue plus cache layer can make the application more reliable and scalable.

I implemented a similar solution while building BillWala.pk, a Pakistan utility information platform that provides guides for checking duplicate electricity and gas bills across multiple DISCOs. For long-term reliability and easier maintenance, I chose the iframe/lightweight-endpoint approach instead of scraping authenticated customer portals, largely because of the concerns around terms of service, site changes, and system stability.

Please or to participate in this conversation.