Toolz Specs API
Public API · engine v4.1.0

One request.
A full datasheet.

Send a phone name or hardware model code — like Android's Build.MODEL — and get a structured spec sheet back. Data is read from GSMArena, normalised, and cached in Redis so repeat lookups are effectively instant. The Device Catalog is the browsing UI built on top of it.

Base URLtoolz-app.vercel.app
AuthGET is public
CacheRedis · no TTL
SourceGSMArena
01

Worked example

Resolving one phone

What happens when a client asks for a single Samsung model code.

Resolve a model code

GET /api/specs?model=SM-S928B
1

Cache lookup

Checks Redis for url_map:sm-s928b. A hit returns the stored payload with "cached": true.

2

Code to name

SM-S928B matches the built-in Samsung pattern: S-series, generation 24, Ultra variant.

3

Catalog match

The resolved name is scored against the GSMArena quicksearch catalog to find the device page.

4

Extract

The page is fetched and parsed into sections — Network, Display, Platform, Battery and so on — with a proxy fallback.

5

Store

Saved under specs:url:<id> plus aliases for the code and full name.

200 OK · application/jsonTrimmed response
{
  "search_query": "SM-S928B",
  "search_name": "Samsung Galaxy S24 Ultra",
  "matched_device": "Samsung Galaxy S24 Ultra",
  "source_url": "https://www.gsmarena.com/samsung_galaxy_s24_ultra-12771.php",
  "image": "https://fdn2.gsmarena.com/vv/bigpic/....jpg",
  "specifications": {
    "Network": { "Technology": "GSM / CDMA / HSPA / EVDO / LTE / 5G" },
    "Display": { "Type": "Dynamic AMOLED 2X, 120Hz", "Size": "6.8 inches" }
  },
  "timing_ms": 2314,
  "cached": false
}
02

Catalog search

What the catalog page calls

The same endpoint powers search, brand filters and the initial grid on /spec.

Filter the cached catalog

GET /api/spec?json=1&q=pixel%209
  1. Loads cached payloads and keeps entries whose device name or original query contains pixel 9.
  2. If nothing matches, the query is resolved once through /api/specs and included with "autoEnriched": true. That is how a new search adds itself to the catalog.
  3. If the cache is empty and no query was given, a few default flagships are resolved so the grid is never blank.
200 OK · application/jsonCatalog envelope
{
  "totalInRedis": 42,
  "count": 3,
  "query": "pixel 9",
  "autoEnriched": false,
  "devices": [ { "...": "same shape as above" } ]
}
03

Endpoints

Contracts

Five endpoints cover lookups, the catalog feed, this document, and cache maintenance.

GET/api/specs?model=…

Resolve one device. model is required — a market name or code such as Pixel 9 Pro XL or HUSKY. Add refresh=1 to skip the cache. Errors: 400 missing param, 404 not in catalog, 502 parse failed. Responses include timing_ms.

GET/api/spec?json=1&q=…

Catalog feed. q filters cached names (minimum 2 characters, triggers auto-enrichment on a miss). Without json=1 it serves the legacy server-rendered HTML catalog.

GET/api/info

This page. ?json=1 returns the same reference as a machine-readable JSON document.

POST/api/sync-devices

Admin. Rebuilds the 25,000+ entry model dictionary. Password-protected. ?action=invalidate-catalog clears the catalog snapshot; ?action=invalidate-specs clears cached specs.

POST/reset

Admin. Clears cache — everything, only payloads, only URL mappings, only the catalog snapshot, or a single model. Password and CSRF protected; three wrong passwords lock the IP for 15 minutes.

04

Model resolution

From model code to market name

Clients send whatever Android reports. Layers run in order and the first hit wins.

  1. Built-in table — common codes: S928 → S24 Ultra, HUSKY → Pixel 8 Pro, CPH2581 → OnePlus 12.
  2. Samsung parser — decodes SM/GT numbers: SM-S928B → S24 Ultra, SM-A366B → A36, SM-F956B → Z Fold6.
  3. Device dictionary — the synced device:<code> map covers the long tail.
  4. Catalog scoring — brand-aware token match against quicksearch; one-letter tokens are ignored and exact matches return immediately.
05

Storage

Redis schema

Every key is written once and reused on subsequent requests.

KeyContent
specs:url:<id>Full JSON payload for one device. Permanent, no expiry.
url_map:<query>Lowercased query → GSMArena URL. A device usually has two aliases: code and full name.
device:<code>Model code → market name, e.g. device:cph2581 → OnePlus 12.
cache:gsm_quicksearch_catalogCatalog snapshot, so matching does not re-download it per request.
gsm:quicksearch_urlWhich snapshot URL is active.
lock:specs:<query>Short lock (~22s): concurrent requests for the same uncached phone wait instead of scraping twice.
06

Notes & limits

Operational behaviour

  • Cache never expires. Cached specs are served as-is until purged via /reset or bypassed with ?refresh=1.
  • Slow first loads time out. Functions abort after 25s (10s for this page). A 502/404 with timing_ms usually means GSMArena was slow — retrying often works.
  • GET endpoints are public and cross-origin (Access-Control-Allow-Origin: *). Admin endpoints require the sync password.
  • Data belongs to GSMArena and is shown for reference with a source link on every device.