Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 6 min read

Comparing cloud server prices is harder than scraping them: lessons from tracking 277 providers

We run CloudTier, a free catalog that compares VPS, dedicated, GPU, storage, managed database and domain prices across 277 providers. Every price is checked daily. Writing the scrapers was the easy part. Making the numb

We run CloudTier, a free catalog that compares VPS, dedicated, GPU, storage, managed database and domain prices across 277 providers. Every price is checked daily.

Writing the scrapers was the easy part. Making the numbers mean the same thing took most of the work. Here are the problems we hit, how we solved them, and how you can use the data from your own code.

1. "Per month" means different things

One provider bills per hour, another per month, a third only per year. To compare them you need one figure, so every plan gets a monthly USD price before tax.

The first trap: an hourly price Γ— 730 is not "the" monthly price. Providers cap hourly billing at different numbers of hours a month (730, 720, 672 or 744), so we store the cap per provider and convert with it. Otherwise hourly clouds look a few percent more expensive than they really are.

The second trap: prepaid terms. A plan sold only as "12 months for $48" is shown as $4/month, but marked with its term so it never looks like a no-commitment price. In the API this is term_months:

"price": { "monthly_usd": 3.28, "term_months": 1, "hourly_usd": null }

2. Exchange rates create fake price changes

Our providers bill in 13 currencies. The obvious design (convert everything to USD, store it, diff it daily) gives you a "price change" every time the euro moves.

So we keep each price in the provider's own currency and compare in that currency. USD values are derived from it and only repriced when the rate drifts noticeably. A price change is reported only when the provider actually changed the price. That is what the price changes page shows.

3. VAT, and providers that only show it included

Most providers list prices before tax, some only with VAT included. Scandinavian registrars, for example, show prices with 25% VAT. The scraper takes the VAT out again and checks that the result lands on a whole cent (ΓΈre). If it doesn't, the row is skipped instead of stored as a slightly wrong price. A missing price is better than a wrong one.

4. Promotions are not list prices

"$1 for the first month" renews at the real price. Promotional offers are flagged and are never what a list sorts by.

Domains are the worst case. A $0.99 first year often renews at $20, so every registrar row also gets a three-year cost (registration + two renewals), and that is the default sort on pages like .com prices across registrars.

5. The same plan costs different amounts in different places

Many clouds charge more in SΓ£o Paulo or Singapore than in Frankfurt. A single "plan price" hides that, so VPS and bare-metal plans store prices per datacenter. When you filter by country (say, VPS plans with servers in Germany), the row shows the cheapest price in that place, not the global minimum.

The same data drives the locations overview, which shows which providers have servers in each country and city.

6. Scrapers break quietly

Provider pages change without notice. A broken parser rarely crashes. It returns plausible garbage: half the plans, or prices off by a factor of 10.

Every run goes through sanity checks before anything is applied. If a run looks wrong (suspicious price jumps, plans vanishing), it is quarantined: the parsed plan is saved for review and the live data stays as the last good run left it. Hard failures are retried, and repeated failures surface in our monitoring.

7. The cache that lived for three minutes

This one is fresh: we fixed it today.

Cached pages were keyed by a catalog version, which every applied scrape run incremented, so prices refresh the moment the data changes. That sounds right until you count: about 530 applied runs a day means a new version every ~3 minutes. Our "12-hour" page cache effectively lived three minutes, and search engine crawlers almost always got a page rendered from scratch. Some of our heaviest pages took 3–7 seconds that way.

The fix:

  • runs only mark the catalog as changed;
  • a beat task publishes a new version at most every 15 minutes;
  • right after publishing, the same task precomputes the expensive shared numbers (location and country stats), so no visitor waits for them.

Two smaller fixes went out with it. A region filter that joined products to datacenters and then ran SELECT DISTINCT over every column (JSON included) became a single EXISTS subquery: 5 s down to 0.3 s. And a helper that normalised city names was being called 106,000 times per computation for a few hundred distinct inputs; an lru_cache fixed that.

The lesson: "invalidate on every change" is correct and still wrong when changes arrive every few minutes. Decide how stale your data is allowed to be, and invalidate on that schedule.

Use the data: a free JSON API

Everything on the site is available through the CloudTier API: read-only JSON with the same filters as the website, no key needed, and an OpenAPI schema.

The cheapest VPS plans in Europe with at least 4 GB RAM:

curl -s "https://cloudtier.io/api/v1/vps/?ram_min=4&region=eu&sort=price_asc&limit=5" \
  | jq -r '.results[] | "\(.price.monthly_usd) USD/mo  \(.specs.vcpus) vCPU  \(.specs.ram_gb) GB  \(.provider.name): \(.name)"'

The same in Python, plus .com prices across registrars, sorted by three-year cost:

import json
import time
import urllib.request

API = "https://cloudtier.io/api/v1"

def get(path):
    req = urllib.request.Request(API + path, headers={"User-Agent": "my-script/1.0"})
    with urllib.request.urlopen(req) as r:
        return json.load(r)

for p in get("/vps/?ram_min=4&region=eu&sort=price_asc&limit=5")["results"]:
    s = p["specs"]
    print(f'{p["price"]["monthly_usd"]:>6.2f} USD/mo  {s["vcpus"]} vCPU  {s["ram_gb"]:g} GB  '
          f'{s["disk_gb"]} GB {s["disk_type"]}  {p["provider"]["name"]}')

time.sleep(5)  # one request every 5 seconds per client

for r in get("/domains/tld/com/")["results"][:5]:
    print(r["provider"]["name"], r["register_usd"], r["renew_usd"], "3y:", r["three_year_usd"])

There are endpoints for VPS, bare-metal servers, GPU servers, managed databases (PostgreSQL, MySQL, Redis/Valkey, MongoDB, OpenSearch), object storage and other storage types, domain extensions and providers. Each plan comes with its specs, its price, the countries it runs in, a value_score and checked_at, the time of the last price check.

The rules are short: one request every 5 seconds per client, at most 50 results a page, and a link back to CloudTier when you publish data from it.

For AI agents: Markdown pages and llms.txt

Every list and plan page also has a Markdown version at the same address plus index.md, for example /vps/index.md. The site publishes an llms.txt that describes all of them. If you build an agent that answers "where should I host this?", it can read current prices instead of guessing from training data.

What we'd like from you

  • Is a provider missing, or does a price look wrong? Tell us in the comments and we'll check it.
  • Building something on the API? We'd love to see it.
  • Want to know when something gets cheaper? Price alerts send one email when a plan, a provider or a domain extension you watch drops past your limit.

Or skip the twelve browser tabs next time and compare cloud and hosting prices on CloudTier.

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.