https://github.com/mohammednudman/play-supported-devices
Typed and optimized local cache of Googleβs supported Android devices list, with exact and partial search.
https://github.com/mohammednudman/play-supported-devices
android cli devices google-play json npm-package open-data search typescript web-scraping
Last synced: 4 months ago
JSON representation
Typed and optimized local cache of Googleβs supported Android devices list, with exact and partial search.
- Host: GitHub
- URL: https://github.com/mohammednudman/play-supported-devices
- Owner: mohammednudman
- License: mit
- Created: 2025-06-25T19:44:50.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-25T20:18:38.000Z (4 months ago)
- Last Synced: 2025-06-25T20:34:43.259Z (4 months ago)
- Topics: android, cli, devices, google-play, json, npm-package, open-data, search, typescript, web-scraping
- Language: TypeScript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# π± play-supported-devices
[](https://www.npmjs.com/package/play-supported-devices)
[](./LICENSE)
[](https://github.com/mohammednudman/play-supported-devices/actions)
> A fast, searchable, auto-updating local cache of [Google Play Supported Devices](https://storage.googleapis.com/play_public/supported_devices.html) as a lightweight NPM package.
---
## π Features
- π§ Pre-parsed JSON of Googleβs supported Android devices
- π Optimized in-memory search engine for exact and partial matches
- β‘ Fast lookups by `manufacturer`, `model`, `codename`, etc.
- π Auto-refresh every 3 hours via GitHub Actions (or manually via CLI)
- β
Zero dependencies for end users
- π¦ Ready for use in Node.js, web tools, or CLIs
---
## π¦ Installation
```bash
npm install play-supported-devices
```
---
## π§ Usage
### Basic Example
```ts
import {
getAllDevices,
searchExact,
searchContains,
listColumns
} from 'play-supported-devices';
const all = getAllDevices();
console.log(`Total devices: ${all.length}`);
const samsungs = searchExact('manufacturer', 'Samsung');
console.log('Samsung devices:', samsungs.length);
const partial = searchContains('model', 'S928');
console.table(partial.slice(0, 5));
console.log('Available columns:', listColumns());
```
---
## π§ Data Structure
Each device entry follows:
```ts
interface DeviceEntry {
marketingName: string; // e.g. "Galaxy S24 Ultra"
device: string; // e.g. "dm3q" (same as codename)
model: string; // e.g. "SM-S928B"
manufacturer: string; // e.g. "Samsung"
codename: string; // e.g. "dm3q"
}
```
---
## π Search API
All queries are **case-insensitive**.
### `getAllDevices(): DeviceEntry[]`
Returns all devices from the local cache.
---
### `searchExact(column, value): DeviceEntry[]`
Find entries where the column exactly matches the value.
```ts
searchExact('manufacturer', 'Samsung');
```
---
### `searchContains(column, value): DeviceEntry[]`
Find entries where the column contains the value.
```ts
searchContains('model', '928B');
```
---
### `listColumns(): (keyof DeviceEntry)[]`
Get list of valid searchable columns:
```ts
['marketingName', 'device', 'model', 'manufacturer', 'codename']
```
---
## π Updating the Cache
### Manually
```bash
npm run update
```
This fetches the latest HTML from Google and updates `data/devices.json`.
### Automatically
A GitHub Actions workflow runs every **3 hours** to keep the cache fresh and versioned.
---
## π» CLI (optional)
> Coming soon
Use the package via CLI with commands like:
```bash
npx play-supported-devices samsung
npx play-supported-devices --contains model S928B
```
---
## π Project Structure
```
.
βββ src/ # Core logic and index
βββ data/devices.json # Auto-updated JSON cache
βββ scripts/update.ts # Refresh logic
βββ test/ # Vitest test suite
βββ README.md
```
---
## β
Development
```bash
npm install
npm run build # Compile with tsup
npm run test # Run tests with vitest
npm run update # Fetch and regenerate devices.json
```
---
## π License
MIT Β© [Mohammed Nudman Raza Shaikh](https://github.com/mohammednudman)
---
## π Contributions
PRs and suggestions welcome!
If the HTML structure changes, feel free to file an issue or submit a parser patch.