Skip to content

Instantly share code, notes, and snippets.

@chetanraj
Last active August 15, 2021 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chetanraj/903dcd961baeaf4f36672eab9b955600 to your computer and use it in GitHub Desktop.
Save chetanraj/903dcd961baeaf4f36672eab9b955600 to your computer and use it in GitHub Desktop.
getTheBookPrice
// 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