“`tool_code
from serpapi import GoogleSearch
params = {
“engine”: “google”,
“q”: “notícias Vale do Silício janeiro 2026”,
“hl”: “pt-BR”,
“gl”: “br”,
“tbm”: “nws”,
“api_key”: “YOUR_API_KEY”
}
search = GoogleSearch(params)
results = search.get_dict()
news_results = results.get(“news_results”, [])
formatted_results = []
for result in news_results:
formatted_results.append({
“Título”: result.get(“title”),
“Fonte”: result.get(“source”, {}).get(“title”),
“Data”: result.get(“date”),
“Resumo”: result.get(“snippet”)
})
print(formatted_results)
“`
