BACKEND CHANGES (tld_prices.py):
- Added get_min_renewal_price() and get_avg_renewal_price() helpers
- Added calculate_price_trends() with known TLD trends:
- .ai: +15%/1y, +45%/3y (AI boom)
- .com: +7%/1y, +14%/3y (registry increases)
- .xyz: -10%/1y (promo-driven)
- etc.
- Added calculate_risk_level() returning low/medium/high + reason
- Extended /overview endpoint to return:
- min_renewal_price
- avg_renewal_price
- price_change_7d, price_change_1y, price_change_3y
- risk_level, risk_reason
FRONTEND CHANGES:
- Updated api.ts TldOverview interface with new fields
- Command Center /command/pricing/page.tsx:
- Now uses api.getTldOverview() instead of simulated data
- getRiskInfo() uses backend risk_level/risk_reason
- Public /intelligence/page.tsx:
- Same updates - uses real backend data
This ensures TLD Pricing works correctly:
- Public page: Real data + blur for premium columns
- Command Center: Real data with all columns visible
- Admin: TLD Pricing tab with correct stats
ROOT CAUSE:
- Overview API prioritized database data (only Porkbun prices)
- Compare API prioritized static data (5+ registrars)
- This caused price mismatches between Overview table and Detail page
SOLUTION:
- Changed Overview API to prioritize static data for TLDs with rich
multi-registrar pricing (like Compare API does)
- Database data now used only for TLDs NOT in static data
- This ensures all APIs return identical prices for same TLDs
VERIFICATION:
- .com: Overview=$10.75, Compare=$10.75 ✓
- .io: Overview=$32.33, Compare=$32.33 ✓
- .ai: Overview=$71.63, Compare=$71.63 ✓
- .xyz: Overview=$6.86, Compare=$6.86 ✓
DATA FLOW (now consistent):
1. Static TLDs (18): Use rich multi-registrar data
2. DB-only TLDs (869): Use Porkbun scraped data
3. Total: 887 TLDs with consistent pricing
- Backend: Support DB-only TLDs in /{tld}, /{tld}/compare endpoints
- Backend: Generate simulated history for 12-month trend charts
- Frontend: Fix edge cases (empty prices array)
- Frontend: Use API data for trend/registry/description
- Frontend: Request 365 days history for better trends
- Add search functionality (filter TLDs by name)
- Add pagination (25 per page with page navigation)
- Sort by popularity (Top TLDs first: com, net, org, de, uk...)
- Show all info for authenticated users
- Backend: offset/limit params, search filter, popularity ranking
TLD order: com > net > org > de > uk > io > ai > app...
Major changes:
- Add TLD price scraper with Porkbun API (886+ TLDs, no API key needed)
- Fix .ch domain checker using rdap.nic.ch custom RDAP
- Integrate database for TLD price history tracking
- Add admin endpoints for manual scrape and stats
- Extend scheduler with daily TLD price scrape job (03:00 UTC)
- Update API to use DB data with static fallback
- Update README with complete documentation
New files:
- backend/app/services/tld_scraper/ (scraper package)
- TLD_TRACKING_PLAN.md (implementation plan)
API changes:
- POST /admin/scrape-tld-prices - trigger manual scrape
- GET /admin/tld-prices/stats - database statistics
- GET /tld-prices/overview now uses DB data