Git Product home page Git Product logo

gsmarena-api's Introduction

GSMArena API

Fetches smartphone specifications from gsmarena website and returns the result as JSON objects.

Usage

getDataFromUrl(url)

  • Description: Returns the source of a page.
  • Parameters:
    • url (str): The URL of the page to retrieve data from.
  • Returns:
    • str: The source of the page.

getBrands()

  • Description: Returns all brands as JSON objects in a list.
  • Returns:
    • list: A list of JSON objects representing brands, each with keys id, name, and devices.

getNextPage(soup)

  • Description: If a 'next page' exists, returns it.
  • Parameters:
    • soup (BeautifulSoup): The BeautifulSoup object representing the current page.
  • Returns:
    • str: The URL of the next page if it exists, else False.

getDevices(soup, devices_list)

  • Description: Returns a refined list of devices as JSON objects.
  • Parameters:
    • soup (BeautifulSoup): The BeautifulSoup object representing the current page.
    • devices_list (list): A list of devices to extract information from.
  • Returns:
    • list: A list of JSON objects representing devices, each with keys id, name, img, and description.

getBrand(brand)

  • Description: Returns all devices of a particular brand.
  • Parameters:
    • brand (str): The brand name.
  • Returns:
    • list: A list of JSON objects representing devices of the brand.

getDevice(device)

  • Description: Scrapes a page of a particular device.
  • Parameters:
    • device (str): The device name.
  • Returns:
    • dict: A dictionary representing the device with keys name, img, quick_spec, detail_spec, pricing, and popularity.

gsmarena-api's People

Contributors

akshay-rajan avatar

Watchers

 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.