Python pricing scrapers for Nigerian VTU services

VTU (Value Transfer Unit) operators in Nigeria often compete on more than price. A rival may charge less for website setup while charging more for VTU API credits, SMS bundles, domains, monthly hosting, support, or transaction fees. Understanding that whole offer is difficult when prices are scattered across several pages and change without notice. This guide explains how to use Python to scrape competitor pricing for VTU services, transform the results into comparable records, and monitor changes responsibly.

Automation is most useful when it replaces repetitive copying, not judgment. For Australian entrepreneurs running Nigerian VTU businesses, it should collect publicly advertised commercial terms, preserve the source and date, and leave room for a human to check unusual results. A small, ethical crawler can reveal market ranges, common package structures, and gaps in your own pricing. It also gives you evidence when deciding whether to adjust a setup fee, monthly plan, or add-on.

Set the scope and permission boundaries

Begin by defining what counts as a competitor price. Include setup packages, monthly VTU platform fees, API credit prices, SMS pricing, domain and hosting charges, support levels, and per-transaction fees where they are public. Exclude customer reviews, private quotations, login-only balances, and personal data. Record both the product and the units: ₦15,000 for a one-time setup is not comparable with ₦15,000 per month or 15,000 NGN of API credit.

Before running code, open each target and read its terms, privacy notice, robots.txt, and any API documentation. robots.txt is a crawling directive, not a complete legal licence, while a public price is not automatically permission for unrestricted collection. Ask the owner for an API or written approval when usage is unclear. Use a descriptive user agent, identify your crawler, keep requests slow, and never bypass a login, paywall, CAPTCHA, or access control. If a page clearly rejects automated access, stop and use a manual sample or approved feed.

Inspect pricing pages before coding

Inspect each pricing page in a browser before selecting elements. Decide whether plans live in ordinary HTML, inside JavaScript widgets, behind pagination, or in separate product pages. Save a page sample for testing and note stable identifiers such as data-plan-name and data-plan-price. Class names may be clearer, but they can change during redesigns, so combine several signals and verify extracted text against the visible page.

Aim for one clean record per plan. Parse the plan title, setup amount, billing period, included features, usage limits, and total price instead of saving an entire block of unrelated copy. The same visual price can mean different things when a page combines setup and renewal costs. A contextual reference such as Elementary Now resources can help you understand the wider Nigerian technology market, but competitor pages remain the authority for the figures you collect.

Build a respectful requests scraper

Start with requests and BeautifulSoup for pages whose prices are present in the initial HTML. Install them in a virtual environment with pip install requests beautifulsoup4, then adapt the selectors to the structure you inspected:

import re
import requests
from bs4 import BeautifulSoup

url = "https://competitor.example/pricing"
headers = {
    "User-Agent": "VTUPriceResearch/1.0 (+https://your-domain.example/bot)"
}
response = requests.get(url, headers=headers, timeout=20)
response.raise_for_status()

soup = BeautifulSoup(response.text, "html.parser")
plans = []

for card in soup.select("[data-pricing-plan]"):
    name = card.select_one("[data-plan-name]")
    price = card.select_one("[data-plan-price]")
    if name and price:
        amount = re.search(
            r"\d[\d,]*(?:\.\d+)?",
            price.get_text(" ", strip=True)
        )
        if amount:
            plans.append({
                "plan": name.get_text(" ", strip=True),
                "price_text": price.get_text(" ", strip=True),
                "amount": amount.group(0),
                "source_url": response.url,
            })

Treat the code as a controlled extractor rather than a universal template. Replace the placeholder URL, user-agent contact, and selectors, then add retry logic with exponential backoff for temporary network errors. Catch timeouts and HTTP errors, validate that expected plans were found, and log a failed run instead of overwriting good data. Schedule a few seconds between page requests, respect any crawl-delay instruction, and keep concurrency low.

Handle JavaScript and paginated offers

Some VTU vendors render plan cards only after JavaScript runs or load prices from an internal request. Playwright can render a normal browser page, but it does not remove the need for permission. Install it with pip install playwright, run playwright install, and stop if the site blocks the browser or requires a CAPTCHA. The following example waits for a stable pricing element:

from playwright.sync_api import sync_playwright

url = "https://competitor.example/pricing"

with sync_playwright() as p:
    browser = p.chromium.launch()
    context = browser.new_context(
        user_agent=(
            "VTUPriceResearch/1.0 "
            "(+https://your-domain.example/bot)"
        )
    )
    page = context.new_page()
    page.goto(url, wait_until="domcontentloaded", timeout=30000)
    page.wait_for_selector("[data-pricing-plan]", timeout=10000)

    cards = page.locator("[data-pricing-plan]")
    for card in cards.all():
        name = card.locator("[data-plan-name]").inner_text()
        price = card.locator("[data-plan-price]").inner_text()
        print({"plan": name, "price_text": price})

    context.close()
    browser.close()

For pagination, follow visible next-page links, store the canonical page URL, and deduplicate plans by a stable combination of provider, plan name, and billing period. Do not create an infinite loop when the final page points back to page one. If prices arrive from a documented JSON endpoint, request that endpoint directly; if it is undocumented or private, ask for access rather than intercepting a session or disguising the crawler.

Normalise plans, fees and currencies

Raw price text is messy, so convert each offer into a consistent schema: provider, plan name, setup price, recurring price, billing period, transaction fee, SMS allowance, support level, source URL, and observation time. Keep the original price text beside parsed numbers, assign NGN or USD only when the page makes the currency clear, and record whether a figure is gross or net of tax. Use decimal arithmetic rather than floating-point values, because a small conversion error can distort comparisons between low-value API transactions and large setup packages.

Australian operators need a second layer of context. A founder in Sydney or Melbourne may price the same Nigerian service in Australian dollars for diaspora clients. The AUD 75,000 GST turnover threshold is relevant to registration, but the treatment of a particular supply and the customer’s location still needs checking; do not assume every sale attracts GST. In Australia, clear AUD invoices and local bank transfer or PayID options can make a digital service easier to buy. When converting NGN, store the exchange rate and its date, using a dated source such as the Reserve Bank of Australia for a defensible reference.

Store snapshots and monitor changes

Save every successful run as a dated snapshot rather than replacing the previous file. A CSV is enough for a small pilot, while SQLite is better when you need queries across providers and months. Include the raw text, parsed amount, currency, plan features, source URL, and timestamp so that a later price change can be explained. Weekly comparisons can then highlight new packages, removed discounts, altered SMS bundles, and changes in setup or renewal fees.

Run the crawler on a measured schedule, such as once a week, and send an alert only when a normalised value changes. Protect stored data with normal business controls, restrict access to pricing research files, and avoid collecting customer names, phone numbers, or transaction histories. Treat an alert as a prompt to open the source page: currency symbols may have changed, a sale may have expired, or a redesign may have shifted the meaning of a field. This verification step keeps bad extractions from becoming false market signals.

Turn price data into a better offer

Compare the median and range for equivalent packages instead of copying the cheapest advertised number. Separate one-time costs from recurring revenue and calculate the margin after API consumption, SMS delivery, payment processing, support time, downtime, taxes, and marketing. A competitor’s low setup price may not be profitable if its monthly VTU renewal is high, while a premium package may be justified by faster support, a branded dashboard, stronger uptime, or better documentation.

Use the findings to design three clear choices for your own audience: a starter website, a growing business package, and a custom enterprise solution. If you operate from Australia while serving Nigerian entrepreneurs, publish both NGN and reference AUD prices, explain which exchange date you use, and state exactly what each package includes. Add services that competitors omit, such as onboarding, backup procedures, security updates, and a short demo, but avoid matching a loss-leading price you cannot sustain. The evidence should guide the offer, not replace your knowledge of the Nigerian VTU market.

Build a useful market view rather than a noisy data dump. Choose one competitor, collect a ten-page pilot, and review every extracted row against the source. Turn the validated records into a dated comparison sheet, identify one pricing gap you can serve, and publish a transparent package built around real costs. Repeat the process on a regular schedule so your pricing responds to the market as it changes.