Introduction
In this article, we will learn how to search for books and display them in our browser using Google books API in ReactJs.
Prerequisites
- Basic knowledge of React.js.
- Basic knowledge of Bootstrap and HTML
- Basic knowledge of React Hooks.
- Visual Studio Code must be installed.
- Node.js must be installed.
Google Book Search API
To get the url for Google books API go to here.

Click on View all developer products and it will redirect you to the products provided by Google for developers.
Search for Google Books API or you can scroll it down and click on B section.

On the Home tab of it you can see there it's showing a category to get the information about the Google books repository, so click on Get started .

Next it will redirect you to the dashboard in the Guides menu of the page so click on using the API menu on the left hand side to get the API.

Scroll down a bit down until you can see the API with API key.

You can check the response of it in our browser without API key it will give an error.

After providing the valid API key you can see its response coming from Google server in a json format.
JSON result gives you all the information of the books with its image url and author's name and its publisher's name etc.

Get the API key
To get the API key just follow the below steps.
On the home menu click on Google Api console you can redirect it to Google api console page where you can find the api key.

Here you have to create a new project. For this just follow the steps.

After that click on the credentials to get the API.

Create ReactJS project
Step 1
Now create a new React.js project by using the following command.
- npx create-react-app googlebooksearch
Step 2
Open the newly created project in Visual Studio code and install react bootstrap in this project by using the following command.
- npm install react-bootstrap --save
Step 3
Now, open the index.js file and add import Bootstrap.
- import 'bootstrap/dist/css/bootstrap.min.css';
Step 4
Now Install the Axios library by using the following command.
Axios is a lightweight HTTP client based on the $http service.
- npm install --save axios
Step 5
It's time to add our app.js code by using the following command.
- import React from 'react'
- import './App.css';
- import Country from './components/country';
- import GoogleBooksSearch from "./googleBooksSearch";
- function App() {
- return (
- <GoogleBooksSearch></GoogleBooksSearch>
- )
- }
- export default App;





Join the conversation! Your thoughts help the community grow.