Search data with the google search API
Demo
Report Bug
Table of Contents
NOTE: The API that was used has been deprecated, at the moment the project is using the API google-search72 which has some limitations.
The /news
and /videos
endpoints no longer exist in this new API, but I've kept the old screenshots below as a matter of curiosity.
Project developed in a JavaScript Mastery channel tutorial to learn React best practices, creating modern user interfaces using Tailwind CSS and most importantly, learn to fetch data from Google Search API using RapidAPI.
The website is divided into:
- Input: enter text to search google api.
- Toggle Button: switch between light and dark themes.
- Home: shows some results for your search.
- News Tab: [DEPRECATED] shows some news related to your search.
- Images Tab: shows some images related to your search.
- Videos Tab: [DEPRECATED] shows some videos related to your search.
Technologies used in the project.
- Create an account on RapidAPI and access the link below.
https://rapidapi.com/neoscrap-net/api/google-search72/pricing/
-
Choose your plan and subscribe (This project uses the free version)
-
Access google-search72 - endpoints, copy the x-rapidapi-key code that will be used in the .env file.
const res = await fetch(`${baseUrl}${url}`, {
method: 'GET',
headers: {
'x-proxy-location': 'EU',
'x-rapidapi-host': 'google-search3.p.rapidapi.com',
'x-rapidapi-key': process.env.REACT_APP_API_KEY,
},
});
- Put the value of
x-rapidapi-key
in the keyREACT_APP_API_KEY
and rename the file from.env.example
to.env
REACT_APP_API_KEY=your-x-rapidapi-key
- If you have an application running, stop the server and run it again to work the environment variable.
- Clone the repo
git clone https://github.com/SilasRodrigues19/Google-Search-API.git
- Install dependencies
npm install
- In the project directory, you can run
npm start
- Open the link below to view the app it in your browser.
http://localhost:3000
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Silas Rodrigues - @jinuye1 - silasrodrigues.fatec@gmail.com
Project Link: https://github.com/SilasRodrigues19/Google-Search-API
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
🔼 Back to top