Giter Club home page Giter Club logo

gsmarena-api-react's Introduction

GSMArena API (gsmarena.com)

GSMArena phone specification and finder. This project is still in early development.

The API basically reads from GSMArena website and results JSON data.

Table of Contents

Implemented Features

  • Get all brands
  • Get devices by brand
  • Get device specification
  • Find devices by keyword
  • Top of devices
  • Hot deals
  • Glossary
  • Glossary detail
  • Find devices by advanced filters
  • News
  • Reviews

Installation

npm i gsmarena-api

Usage

Import

const gsmarena = require('gsmarena-api');

Brand list

const brands = await gsmarena.catalog.getBrands();
console.log(brands);
[
  {
    "id": "apple-phones-48",
    "name": "Apple",
    "devices": 98
  }
]

Device list by brand

const devices = await gsmarena.catalog.getBrand('apple-phones-48');
console.log(devices);
[
  {
    "id": "apple_iphone_13_pro_max-11089",
    "name": "iPhone 13 Pro Max",
    "img": "https://fdn2.gsmarena.com/vv/bigpic/apple-iphone-13-pro-max.jpg",
    "description": "Apple iPhone 13 Pro Max smartphone. Announced Sep 2021..."
  }
]

Device detail

const device = await gsmarena.catalog.getDevice('apple_iphone_13_pro_max-11089');
console.log(device);
{
  "name": "Apple iPhone 13 Pro Max",
  "img": "https://fdn2.gsmarena.com/vv/bigpic/apple-iphone-13-pro-max.jpg",
  "quickSpec": [
    {
      "name": "Display size",
      "value": "6.7\""
    }
  ],
  "detailSpec": [
    {
      "category": "Network",
      "specifications": [
        {
          "name": "Technology",
          "value": "GSM / CDMA / HSPA / EVDO / LTE / 5G"
        }
      ]
    }
  ]
}

Searching for device

const devices = await gsmarena.search.search('casio');
console.log(devices);
[
  {
    "id": "casio_g_zone_ca_201l-5384",
    "name": "Casio G'zOne CA-201L",
    "img": "https://fdn2.gsmarena.com/vv/bigpic/casio-gzone-ca-201l.jpg",
    "description": "Casio G'zOne CA-201L Android smartphone. Announced Mar 2013..."
  }
]

Top

const top = await gsmarena.top.get();
console.log(top);
[
  {
    "category": "Top 10 by daily interest",
    "list": [
      {
        "position": 1,
        "id": "xiaomi_12-11285",
        "name": "Xiaomi 12",
        "dailyHits": 50330
      }
    ]
  }
]

Deals

const deals = await gsmarena.deals.getDeals();
console.log(deals);
[
  {
    "id": "oneplus_9-10747",
    "img": "https://m.media-amazon.com/images/I/31ICm7rK-hS._SL500_.jpg",
    "url": "https://www.amazon.co.uk/dp/B08V1NKHZF?tag=gsmcom-21&linkCode=osi&th=1&psc=1",
    "name": "OnePlus 9",
    "description": "OnePlus 9 5G (UK) SIM-Free Smartphone with Hasselblad Camera for Mobile - Arctic Sky...",
    "deal": {
      "memory": "128GB 8GB RAM",
      "storeImg": "https://fdn.gsmarena.com/imgroot/static/stores/amazon-uk1.png",
      "price": 449.00,
      "currency": "£",
      "discount": 24.6
    },
    "history": [
      {
        "time": "Previous",
        "price": 479.00,
        "currency": "£"
      }
    ]
  }
]

Glossary

const glossary = await gsmarena.glossary.get();
console.log(glossary);
[
  {
    "letter": "X",
    "list": [
      {
        "id": "xenon-flash",
        "name": "Xenon flash"
      }
    ]
  }
]

Glossary detail

const term = await gsmarena.glossary.getTerm('xenon-flash');
console.log(term);
{
  "title": "Xenon flash - definition",
  "html": "<p>A xenon flash produces an extremely intense full-spectrum white...</p>"
}

Contact

Created by @nordmarin - feel free to contact me!

License

GSMArena API is MIT licensed.

gsmarena-api-react's People

Contributors

nordmarin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.