News Intel from CLI (free API)

Jon
2 min readJan 17, 2023

--

Ever wanted news from a curl?

lets try to grab cyber news and analyze whats trending with a free API and jq.

first install jq if you don’t have it with brew.

brew install jq

then run a curl with a free API setup here using https://newsapi.org/

curl https://newsapi.org/v2/everything -G \
-d q=CyberSecurity \
-d from=2023–01–17 \
-d sortBy=popularity \
-d apiKey=XXXXXXXXXXXXXXXXXXX | jq

Filter on keyword XDR

After filter is applied only 1 article was found for a single day search in sort by popularity.

curl https://newsapi.org/v2/everything -G \
-d q=CyberSecurity \
-d from=2023–01–17 \
-d sortBy=popularity \
-d apiKey=XXXXXXXXXXXXXXXXXXX | jq | grep "XDR"

filter down to apple

by adding

| grep "apple"

this now looks like

curl https://newsapi.org/v2/everything -G \
-d q=CyberSecurity \
-d from=2023–01–17 \
-d sortBy=popularity \
-d apiKey=XXXXXXXXXXXXXXXXXXX | jq | grep "apple"

Now you can adjust date stamp to check if anything occurred over weekend or another day you want to understand any news that occured for a vender. Its recommended to check your stack your trying to protect by using grep on words like “Linux” and or “Mac” ”Apple” and anything that would be a keyword in the article you might want to know about anything trending in that area of interest.

Instead of reading a RSS feed of tons of possible malvertised articles on common websites you can do it from CLI and avoid any drive by downloads and only read what’s popular and has most important keywords.

--

--

Jon
Jon

Written by Jon

Articles about technology and comes from NY and has traveled the world.

No responses yet