Last active
August 15, 2021 12:39
-
-
Save chetanraj/903dcd961baeaf4f36672eab9b955600 to your computer and use it in GitHub Desktop.
getTheBookPrice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hit BooksRun API - To get the new, used and rent price | |
getTheBookPrice = (ISBN) => { | |
return new Promise((resolve, reject) => { | |
const URL = `https://booksrun.com/API/v3/price/buy/${ISBN}?key=${process.env.API_KEY}`; | |
fetch(URL) | |
.then((response) => { | |
resolve(response.json()); | |
}) | |
.catch((err) => { | |
reject(err); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment