DEV Community

MOJOMOJO
MOJOMOJO

Posted on

How I Built a Phone Specs API with 200 Phones and $0 Monthly Cost

How I Built a Phone Specs API and Launched It on RapidAPI

I spent a weekend building a smartphone specifications API. Here's the tech stack, the decisions I made, and how you can build one too β€” plus how I expanded it to 200 phones for $0/month.

Why Phone Specs?

I needed structured phone specification data for a comparison tool. Existing solutions were either:

  • Too expensive ($99+/month)
  • Outdated (2022 specs)
  • Missing Chinese brands (Xiaomi, OPPO, vivo, Huawei)

So I built my own.

The Stack

Layer Choice Why
API FastAPI Fast, auto-docs (Swagger UI), async
Data JSON file No DB overhead for 200 records
Hosting Railway Auto-deploy from GitHub, free tier
Distribution RapidAPI Built-in billing, rate limiting, discoverability
Search In-memory Python Levenshtein scoring, no Elasticsearch needed

Total monthly cost: $0 (Railway free tier + RapidAPI free plan)

The Schema

Each phone record has 38 fields covering:

  • Display: size, type, resolution, refresh rate
  • Performance: chipset, CPU cores, GPU, RAM, storage
  • Camera: main, count, specs, front, video
  • Battery: capacity, wired/wireless charging
  • Design: weight, dimensions, water resistance, material
  • Connectivity: 5G, NFC, infrared, headphone jack
{
  "id": "samsung_galaxys25ultra",
  "brand": "Samsung",
  "model": "Galaxy S25 Ultra",
  "screen_size": "6.8θ‹±ε―Έ",
  "screen_type": "Dynamic LTPO AMOLED 2X",
  "resolution": "3120x1440",
  "refresh_rate": "120Hz",
  "chipset": "Snapdragon 8 Gen 4",
  "ram": "16GB",
  "storage": "512GB",
  "rear_camera_main": "200MP",
  "battery_capacity": "5000mAh",
  "os": "Android 15",
  "water_resistance": "IP68"
}
Enter fullscreen mode Exit fullscreen mode

The Endpoints

# Search by keyword
GET /api/v1/search?q=iPhone&limit=10

# Full specs by ID
GET /api/v1/specs/apple_iphone16promax

# Side-by-side comparison
GET /api/v1/compare?id1=apple_iphone16pro&id2=samsung_galaxys25ultra

# Brand catalog
GET /api/v1/brands

# Database stats
GET /api/v1/stats
Enter fullscreen mode Exit fullscreen mode

Six endpoints. No auth required for the demo.

Current Coverage

  • 200 phones across 24 brands
  • Flagships: iPhone 16 Pro Max, Galaxy S25 Ultra, Pixel 9 Pro, Mate 70 Pro
  • Foldables: Galaxy Z Fold 6, Z Flip 6, OnePlus Open, Pixel 9 Pro Fold
  • Budget: Redmi Note 14, Realme 14 Pro, OPPO A3, vivo Y200
  • Plus tablets: Galaxy Tab S9/S10 series, iPad Pro/Air

Try It Live

Live demo: phone-specs-api-production.up.railway.app

Swagger docs: /docs

Get It on RapidAPI

Three pricing tiers:

Plan Requests Price
FREE 100/day $0
PRO 5,000/month $19.99
ULTRA 50,000/month $49.99

Subscribe on RapidAPI

πŸ“¦ Buy the Dataset β€” Full CSV, 200 phones Γ— 38 fields, $9.99 one-time.


Source code on GitHub β€” MIT licensed.

Top comments (0)