Skip to content

Repository files navigation

TechSpecs LogoTechSpecs Logo

Introducing TechSpecs JavaScript/TypeScript

This node library provides programatic access to the standardized specs of over 61,000 consumer electronics devices, including the latest smartphones, tablets, smartwatches, laptops, and more.

Documentation

API Key

Requirements

  • NodeJS v12.x or ES6

Installation

How to install TechSpecs

npm install techspecs

Usage

The library needs to be configured with your account's api key and base which is available in your TechSpecs Dashboard.

Set techspecs_key to your key value and techspecs_base to your base value.

Basic Search

Search for a device by specifying it's model name, version number or features

// Search for a product by name, version or featuresimport{techspecs}from"techspecs";// self invoking async functionasyncfunctionsearch(){// TechSpecs API Keyconsttechspecs_key="techspecs_api_key";// TechSpecs base https://apis.dashboard.techspecs.io/{techspecs_base}consttechspecs_base="a8TD3mkN49fhg2y";constquery={keyword: "iPhone 13",// product name or version number to searchcategory: "all",// product category to search};// choose between "pretty" or "raw" mode for viewing responseconstresponse=awaittechspecs.search(base,query,key,(mode="pretty"));// print the search resultsconsole.log(response);}

Advanced Search

List all products by brand, category and release date

// List all products by brand, category and release dateimport{techspecs}from"techspecs";// self invoking async functionasyncfunctiongetProducts()=>{// TechSpecs API Keyconsttechspecs_key="techspecs_api_key";// TechSpecs base https://apis.dashboard.techspecs.io/{techspecs_base}consttechspecs_base="a8TD3mkN49fhg2y";// enter the page number to fetch results fromconstpage=1;// type in the name of the brand you're looking for or leave this field empty to see results from all brandsconstbrand=["Apple"];// type in the name of the category you're looking for or leave this field empty to see results from all categoriesconstcategory=["smartphone"];// please provide a date range to narrow your search. Leave this field empty to fetch all results from all datesconstdate={from: "2010-01-01",// YYYY-MM-DDto: "2022-03-15",// YYYY-MM-DD};// choose between "pretty" or "raw" mode for viewing responseconstresponse=awaittechspecs.products(techspecs_base,brand,category,date,page,techspecs_key,"pretty");// print the search resultsconsole.log(response);}

Product Details

// Get the standardized specifications of a specified productimport{techspecs}from"techspecs";// self invoking async functionasyncfunctiongetDetails()=>{// TechSpecs API Keyconsttechspecs_key="techspecs_api_key";// TechSpecs base https://apis.dashboard.techspecs.io/{techspecs_base}consttechspecs_base="a8TD3mkN49fhg2y";// TechSpecs product idconsttechspecs_id="6186b047987cda5f88311983";// choose between "pretty" or "raw" mode for viewing responseconstresponse=awaittechspecs.detail(techspecs_base,techspecs_id,techspecs_key,(mode="pretty"));// print the specifications of the productconsole.log(response);}

List all brands

import{techspecs}from"techspecs";// self invoking async functionasyncfunctiongetBrands()=>{// TechSpecs API Keyconsttechspecs_key="techspecs_api_key";// TechSpecs base https://apis.dashboard.techspecs.io/{techspecs_base}consttechspecs_base="a8TD3mkN49fhg2y";// choose between "pretty" or "raw" mode for viewing responseconstresponse=awaittechspecs.brands(techspecs_base,techspecs_key,(mode="pretty"));// print the list of all brandsconsole.log(response);}

List all categories

import{techspecs}from"techspecs";// self invoking async functionasyncfunctiongetAllCategories()=>{// TechSpecs API Keyconsttechspecs_key="techspecs_api_key";// TechSpecs base https://apis.dashboard.techspecs.io/{techspecs_base}consttechspecs_base="a8TD3mkN49fhg2y";// choose between "pretty" or "raw" mode for viewing responseconstresponse=awaittechspecs.categories(techspecs_base,techspecs_key,(mode="pretty"));// print the list of all categoriesconsole.log(response);}

About

Progamtically get the standardized specs of over 61,000 consumer electronics devices, including the latest smartphones, tablets, smartwatches, laptops, and more.

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages