This API is implemented with graphQL which web scrapes data from https://gsmarena.com
npm i
npm run start
To test the API queries, click on http://localhost:4000/graphql
getAllBrands {
name
slug
}
getDevicesByBrand(brandSlug: $brandSlug) {
imageUrl
productName
slug
}
brandSlug :- Slug received from the respective brands from getAllBrands call
getDeviceDetails(mobileSlugs: $mobileSlugs) {
products
title
}
mobileSlug :- Slug received from the repective mobiles from getDevicesByBrand call
The above calls can also be combined as below. (feel free to playaround)
getAllBrands(brandName: $brandName) {
name
device {
imageUrl
productName
deviceDetails {
products
title
}
}
}
This gets the list of all the mobiles of the specified brands with details.