An app to fetch news from Free News API (Rapid API, Docs)
- Catch news from various souces with Free News API
- Search news by keywords, sources and date (up to a month old).
- Language: English / Japanese
- Register kewords as favorites and call them back later (cookie must be enabled).
It is built with Next.js, TypeScript, Redux-Toolkit and Material-UI. Also, Redux-Toolkit Query is used for fetching and state management of news data.
You need to create a Rapid API account and get an API KEY for Basic Plan (free for non-commercial use). See this Link for details. You can also apply for Contributor Plan that gives more access to the Free News API.
Create .env.local file in the root folder and define the key there as enviromental variables to protect it.
// .env.local file
NEXT_PUBLIC_RAPID_API_KEY='<YOUR API KEY>'
NEXT_PUBLIC_RAPID_API_HOST=free-news.p.rapidapi.com
If you want to use Google Analysis, store the Ttracking ID in .env.local file as well.
GA_TRACKING_ID=xxxxxxxx
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.