Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Trade-In Estimator

A device trade-in value estimator built with vanilla JavaScript. Demonstrates how to combine MobileAPI device data with custom business logic.

Features

  • Search for any device with autocomplete
  • View key specifications (display, storage, battery, chipset)
  • Select device condition (excellent, good, fair, poor)
  • Instant trade-in value estimate with price range
  • Breakdown showing how the estimate was calculated
  • Clean, responsive dark-themed UI
  • Zero dependencies

Setup

  1. Get a free API key at mobileapi.dev/signup
  2. Open index.html in your browser
  3. Paste your API key into the input bar

No build step required.

How the Pricing Algorithm Works

The estimator uses a simplified algorithm based on device specifications:

  1. Base value -- determined by device tier (flagship, mid-range, budget) using name and chipset hints
  2. Age depreciation -- value decreases based on how many years since release
  3. Storage bonus -- higher storage configurations add value
  4. Condition multiplier -- applied last based on user-selected condition
Condition Multiplier
Excellent 100%
Good 80%
Fair 60%
Poor 35%

This is a demonstration algorithm. Real trade-in platforms use market data, historical pricing, supply/demand signals, and more sophisticated valuation models.

Use Cases

This example shows how MobileAPI data can power:

  • Trade-in platforms -- estimate device values for buyback programs
  • Resale marketplaces -- suggest listing prices
  • Insurance tools -- calculate replacement values
  • Retail tools -- offer trade-in credit toward new purchases

Files

File Description
index.html Main HTML page
style.css Styles (dark theme, responsive)
app.js Search, spec display, and pricing logic

Links