Python 3 Google News Feed API to Fetch Latest News of Any Topic in Any Country in Terminal
56 views
Jun 3, 2025
Get the full source code of application here:
View Video Transcript
0:00
uh hello guys uh welcome to this video
0:02
so in this video I will show you how to
0:05
use the Google news API to get news of
0:09
any country of any topic right in the
0:12
Python application right in your
0:13
terminal so there is a Google news API
0:17
so if you just type here on Google
0:19
Google News so this Google News has this
0:22
website here if you want to scrape the
0:25
stories from this website they do
0:27
provide their own API as well if you
0:29
just write so all these stories that you
0:31
see of relevant countries here
0:36
so Google News API so they do have their
0:39
own API as well in this tutorial I will
0:42
show you a free Python package which
0:44
actually scrapes this API so just go to
0:47
this website just search for this module
0:50
which is uh G news client g News client
0:55
if you search for this module it
0:56
actually is a Python client for the
0:58
Google News feed API you just need to
1:01
install this module first of all simply
1:04
execute this command pip install g news
1:07
client so it it actually uses in the
1:10
Google news feed API in the background
1:13
so once you install this just create a
1:15
simple python py file and simply you
1:19
need to require this module G news
1:23
client from this we just need to
1:26
import the G news client after that we
1:30
we initialize this client here by
1:33
specifying using this function here
1:36
which is news client and here you need
1:38
to mention four properties here first of
1:40
all the language in which language you
1:43
want the news to be i want the language
1:45
to be English language second argument
1:48
will be the location in which location
1:50
you want to grab the news so I will
1:52
specify here India you can specify any
1:56
country of your choice the third topic
1:58
the third argument is the which topic
2:01
you want to grab the news so I will
2:03
simply here say
2:05
sports i want to grab the sporting news
2:08
you can put any topic here and then the
2:10
fourth topic here maximum
2:13
results so how many maximum results you
2:16
want to grab so the maximum value I
2:18
think is 10 but yeah you can put here 10
2:21
so 10 stories 10 latest topics latest
2:24
news will be grabbed here from the
2:27
location India on the topic of sports in
2:30
English language so now if you want to
2:32
print this out so we simply say news
2:36
list and we simply get the news here by
2:40
calling this function which is get news
2:43
this will get the news and now we will
2:45
need to print out this as this is an
2:48
array here we will print out each story
2:51
each story will have three properties
2:53
here first of all the title of the
2:57
news so here we print the title here by
3:01
using uh
3:05
item
3:08
title similarly we print out the link of
3:11
the
3:13
story the third that's all I
3:17
think so if you just refresh your
3:20
application just initialize
3:22
this so now if you see it returns 10
3:26
stories Here each story you will see it
3:30
is having 10 stories here related to
3:32
India this is sports news daily capitals
3:35
Gujarat titans live code card you will
3:38
see this it also gives the link of this
3:40
story here if you want to copy this
3:48
link if I copy this try to open this in
3:52
the browser this is actually
3:54
the direct link of the story from Google
3:58
news feed you will see it is grabbing
4:01
this today's date is May 18th 2025 so
4:06
it's a latest story today's story it has
4:08
scraped here so you it's a free module
4:10
here you can see you can put any country
4:12
put any topic here it will grab the 10
4:14
latest stories from that specific
4:16
country on that specific topic here you
4:18
will see 19 club in men's
4:22
traveling now let's suppose I change
4:24
this country here from India to let's
4:27
suppose USA and I change the topic from
4:30
sports to politics and uh again run the
4:33
script here you will see now it will
4:36
actually grab the 10 latest stories from
4:38
USA country and uh you will
4:45
see so you can see that now the result
4:48
is different you can try this module
4:51
here run inside your own machine it's a
4:54
free module that's the main part it
4:56
doesn't require any API key it's
4:58
completely free simply install this
5:00
module and try to run this on your own
5:03
machine you
5:04
do this unlimited number of time there
5:06
is no kind of restriction out there so
5:09
thank you very much for watching this
5:11
video please hit that like button
5:13
subscribe the channel and also check out
5:14
my website freemediatools.com
5:17
uh which contains thousands of tools
#Business News
#Local News
#News
#Scripting Languages
#Sports News
#World News