i am creating a realtime customised news feed using tavily ai whose documentation is like// To install: npm i @tavily/core const { tavily } = require('@tavily/core'); const client = tavily({ apiKey: "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" }); client.search(query="latest update of india ", { topic: "news", searchDepth: "advanced", maxResults: 2, timeRange: "day", includeAnswer: "basic", includeImages: true, includeImageDescriptions: true, includeRawContent: true, days: 6 }) .then(console.log); ( options are searchDepth and includeAnswer basic / advanced and these three are includeImages: true, includeImageDescriptions: true, includeRawContent: true are always true , those are checkbox , if not selected then dont mentions these fields, the numbers are changable ) the sample output is : { "query": "latest update of india ", "follow_up_questions": null, "answer": "India's exports surged to a record $820 billion in 2024-25 despite global challenges. The Indian economy remains resilient despite global uncertainty, according to Home Minister Amit Shah. Trump has paused tariffs on countries like India that did not retaliate, providing some relief amidst ongoing economic challenges. The extradition of Tahawwur Rana is seen as a significant diplomatic win for the Modi government, aiding in exposing the role of Pakistani agencies in the 26/11 attacks. Bank of India and UCO Bank cut lending rates following the RBI repo rate slash. The government has ended the transshipment facility for Bangladesh’s export cargo due to growing rhetoric from Dhaka.", "images": [ { "url": "https://static.tnn.in/thumb/msid-101060676,updatedat-1686981154400,width-1280,height-720,resizemode-75/101060676.jpg", "description": "Ajit Pawar is speaking passionately while heaping praises on PM Modi during a press event." }, { "url": "https://resize.indiatvnews.com/en/resize/newbucket/1200_-/2024/07/modi-1719996314.jpg", "description": "The setting features a thoughtful Narendra Modi, dressed in a formal outfit, seated at a governmental assembly, engaged in a moment of contemplation." }, { "url": "https://resize.indiatvnews.com/en/resize/newbucket/1200_-/2023/11/breaking-news-1699080527-1699151807.jpg", "description": "A vibrant graphic displays the words \"LIVE BREAKING NEWS\" prominently against a blue background with dynamic wave patterns." }, { "url": "https://english.cdn.zeenews.com/sites/default/files/2023/06/12/1218499-cyclone-biparjoy-live-update-weather.jpeg", "description": null }, { "url": "https://resize.indiatvnews.com/en/centered/newbucket/1200_675/2023/11/breaking-news-live-1700276865-1700441177.jpg", "description": "The design features the words \"LIVE BREAKING NEWS\" prominently displayed, set against a dark background with a subtle image of the Earth." } ], "results": [ { "url": "https://www.socialnews.xyz/2025/04/10/asia-shares-jump-after-trump-pauses-most-of-his-tariffs-but-uncertainty-remains-video/", "raw_content": "Published Time: 2025-04-10T07:47:02+00:00\nAsia shares jump after Trump pauses most of his tariffs but uncertainty remains (Video) - Social News XYZ\nMENU\nHome ►\nAuthors\nPolitics ►\nNational\nInternational ►\nDiaspora\nDiplomacy\nMovies ►\nSouth Cinema\nSocial News XYZ Reviews\nBollywood\nReviews\nBox Office\nMovie Schedules\nHollywood\nInterviews\nTV\nGallery ►\nTollywood\nBollywood\nHollywood\nActresses\nPolitics\nSports\nOther\nVideos ►\nMovies News\nTrailers\nJukebox\nLive Events\nLive TV\nBusiness\nSports ►\nGreen Bag\nCricket\nAthletics\nBadminton\nFootball\nGolf\nHockey\nMotorsports\nTennis\nOther Sports\nScience/Tech ►\nBusiness Wire India\nHealth\nStudy\nEnvironment ►\nWildlife\nArchives\nTelugu\n[General](https://www.socialnews.xyz/category/general/) ►\nCommentary\nCrime\nDisaster\nAccident\nDefence\nArmy\nHome\nAuthors\nPolitics\nNational\nInternational\nDiaspora\nDiplomacy\nMovies\nSouth Cinema\nSocial News XYZ Reviews\nBollywood\nReviews\nBox Office\nMovie Schedules\nHollywood\nInterviews\nTV\nGallery\nTollywood\nBollywood\nHollywood\nActresses\nPolitics\nSports\nOther\nVideos\nMovies News\nTrailers\nJukebox\nLive Events\nLive TV\nBusiness\nSports\nGreen Bag\nCricket\nAthletics\nBadminton\nFootball\nGolf\nHockey\nMotorsports\nTennis\nOther Sports\nScience/Tech\nBusiness Wire India\nHealth\nStudy\nEnvironment\nWildlife\nArchives\nTelugu\nGeneral\nCommentary\nCrime\nDisaster\nAccident\nDefence\nArmy\nHome » Videos » Asia shares jump after Trump pauses most of his tariffs but uncertainty remains (Video)\nAsia shares jump after Trump pauses most of his tariffs but uncertainty remains (Video)\nPosted By: Social News XYZ April 10, 2025\nAsian stock markets recovered on Thursday after Trump tariff trauma. But uncertainty remains, especially between the US and China, according to veteran Hong Kong investment manager Francis Lun.\nstockmarket #tariffs #news\nPicture credit: Kyodo News via AP\nSubscribe: http://smarturl.it/AssociatedPress\nRead more: https://apnews.com\nThis video may be available for archive licensing via https://newsroom.ap.org/home\nFacebook Comments\nAbout SocialNewsXYZ\nAn Indo-American News website. It covers Gossips, Politics, Movies, Technolgy, and Sports News and Photo Galleries and Live Coverage of Events via Youtube. The website is established in 2015 and is owned by AGK FIRE INC.\nMail\n| Web\n| Twitter\n|*\nFacebook\nLike this:\nLike Loading...\nSummary\nTitle\nAsia shares jump after Trump pauses most of his tariffs but uncertainty remains (Video)\nDescription\nAsian stock markets recovered on Thursday after Trump tariff trauma. But uncertainty remains, especially between the US and China, according to veteran Hong Kong investment manager Francis Lun. #stockmarket #tariffs #news Picture credit: Kyodo News via AP Subscribe: http://smarturl.it/AssociatedPress Read more: https://apnews.com This video may be available for archive licensing via https://newsroom.ap.org/home\nPrevious post\nNext post\nSearch\nFollow Us\nFacebookInstagramPinterestBlueskyGoogle MapsLinkedInXYouTube ChannelFeed\nGallery\nBratislava: President Murmu attends state banquet at Bratislava Castle #Gallery\nNew Delhi: Inspection of Supplementary Drain in Wazirabad #Gallery\nPatna: BJP Leaders Attend Workshop Marking Ambedkar Jayanti – #Gallery\nNew Delhi: Inspection of Barapula bridge drain – #Gallery\nPatna: BJP Leaders Attend Workshop Marking Ambedkar Jayanti – #Gallery\nNew Delhi: Palam Air Force Station area ahead of Tahawwur Rana’s arrival #Gallery\nMumbai: Celebrities Spotted At Airport #Gallery\nRanchi: Mahavir Jayanti celebrations #Gallery\nAkkada Ammai Ikkada Abbai Pre Release Pressmeet – Gallery\nLondon: India UK Economic Dialogue. #Gallery\nTop Stories\nCJI Sanjeev Khanna-led Bench to hear on April 16 pleas against Waqf Amendment Act\nRamadoss replaces son Anbumani as PMK Prez ahead of 2026 TN Assembly polls\nFed biryani to Kasab: BJP slams Cong, thanks PM Modi for Tahawwur Rana’s extradition\nFiring resumes between security forces and terrorists in J&K’s Udhampur\nTahawwur Rana’s extradition to help India expose role of Pak agencies in 26/11\nIndia’s exports surge to record $820 billion in 2024-25 despite global challenges\nUpdated salary portal of Bengal govt schools continues showing names of 25,753 job losers\nDelhi L-G, CM Gupta inspect Yamuna cleaning drive at Wazirabad, discuss riverfront revamp\nTahawwur Rana to be interrogated by high-level NIA team amid tight security\n‘Haven’t slept all night’: Archer Rajat Chauhan thrilled as compound archery joins LA 2028 Olympics\nArchives\nArchives\nCopyright 2025 | AGK FIRE INC| Terms of Service / Privacy Policy | Contact Us\nFacebookTwitterWhatsAppTelegramShare\nFacebookTwitterWhatsAppTelegramShare\n%d\n✓\nThanks for sharing!\nAddToAny\nMore…\nAddToAny\nMore…", "title": "Asia shares jump after Trump pauses most of his tariffs but uncertainty remains (Video) - Social News XYZ", "score": 0.3421763, "published_date": "Thu, 10 Apr 2025 07:49:12 GMT", "content": "Fed biryani to Kasab: BJP slams Cong, thanks PM Modi for Tahawwur Rana’s extradition\nFiring resumes between security forces and terrorists in J&K’s Udhampur\nTahawwur Rana’s extradition to help India expose role of Pak agencies in 26/11\nIndia’s exports surge to record $820 billion in 2024-25 despite global challenges\nUpdated salary portal of Bengal govt schools continues showing names of 25,753 job losers\nDelhi L-G, CM Gupta inspect Yamuna cleaning drive at Wazirabad, discuss riverfront revamp [...] New Delhi: Palam Air Force Station area ahead of Tahawwur Rana’s arrival #Gallery\nMumbai: Celebrities Spotted At Airport #Gallery\nRanchi: Mahavir Jayanti celebrations #Gallery\nAkkada Ammai Ikkada Abbai Pre Release Pressmeet – Gallery\nLondon: India UK Economic Dialogue. #Gallery\nTop Stories\nCJI Sanjeev Khanna-led Bench to hear on April 16 pleas against Waqf Amendment Act\nRamadoss replaces son Anbumani as PMK Prez ahead of 2026 TN Assembly polls [...] Cricket\nAthletics\nBadminton\nFootball\nGolf\nHockey\nMotorsports\nTennis\nOther Sports\nScience/Tech ►\nBusiness Wire India\nHealth\nStudy\nEnvironment ►\nWildlife\nArchives\nTelugu\n[General](https://www.socialnews.xyz/category/general/) ►\nCommentary\nCrime\nDisaster\nAccident\nDefence\nArmy\nHome\nAuthors\nPolitics\nNational\nInternational\nDiaspora\nDiplomacy\nMovies\nSouth Cinema\nSocial News XYZ Reviews\nBollywood\nReviews\nBox Office\nMovie Schedules\nHollywood\nInterviews\nTV\nGallery\nTollywood\nBollywood\nHollywood\nActresses" }, { "url": "https://www.socialnews.xyz/2025/04/09/latest-details-on-trumps-tariff-pause-video/", "raw_content": "Home » Videos » Latest details on Trump’s tariff pause (Video)\nLatest details on Trump’s tariff pause (Video)\nPosted By: Social News XYZ\nApril 9, 2025\nPresident Trump announced Wednesday he's increasing tariffs on China while pausing reciprocal tariffs against most other U.S. trade partners for 90 days. Lindsay Reiser anchored CBS News' live coverage.\nCBS News 24/7 is the premier anchored streaming news service from CBS News and Stations that is available free to everyone with access to the internet and is the destination for breaking news, live events, original reporting and storytelling, and programs from CBS News and Stations' top anchors and correspondents working locally, nationally and around the globe. It is available on more than 30 platforms across mobile, desktop and connected TVs for free, as well as CBSNews.com and Paramount+ and live in 91 countries.\nSubscribe to the CBS News YouTube channel: https://youtube.com/cbsnews\nWatch CBS News 24/7: https://cbsnews.com/live/\nDownload the CBS News app: https://cbsnews.com/mobile/\nFollow CBS News on Instagram: https://instagram.com/cbsnews/\nLike CBS News on Facebook: https://facebook.com/cbsnews\nFollow CBS News on X: https://x.com/cbsnews\nSubscribe to our newsletters: https://cbsnews.com/newsletters/\nTry Paramount+ free: https://paramountplus.com/?ftag=PPM-05-10aeh8h\nFor video licensing inquiries, contact: licensing@veritone.com\nAbout SocialNewsXYZ\nAn Indo-American News website.\nIt covers Gossips, Politics, Movies, Technolgy, and Sports News and Photo Galleries and Live Coverage of Events via Youtube.\nThe website is established in 2015 and is owned by AGK FIRE INC.\nLike this:\nPresident Trump announced Wednesday he's increasing tariffs on China while pausing reciprocal tariffs against most other U.S. trade partners for 90 days. Lindsay Reiser anchored CBS News' live coverage.\nCBS News 24/7 is the premier anchored streaming news service from CBS News and Stations that is available free to everyone with access to the internet and is the destination for breaking news, live events, original reporting and storytelling, and programs from CBS News and Stations' top anchors and correspondents working locally, nationally and around the globe. It is available on more than 30 platforms across mobile, desktop and connected TVs for free, as well as CBSNews.com and Paramount+ and live in 91 countries.\nSubscribe to the CBS News YouTube channel: https://youtube.com/cbsnews\nWatch CBS News 24/7: https://cbsnews.com/live/\nDownload the CBS News app: https://cbsnews.com/mobile/\nFollow CBS News on Instagram: https://instagram.com/cbsnews/\nLike CBS News on Facebook: https://facebook.com/cbsnews\nFollow CBS News on X: https://x.com/cbsnews\nSubscribe to our newsletters: https://cbsnews.com/newsletters/\nTry Paramount+ free: https://paramountplus.com/?ftag=PPM-05-10aeh8h\nFor video licensing inquiries, contact: licensing@veritone.com\nSearch\nFollow Us\nGallery\nAkkada Ammai Ikkada Abbai Pre Release Pressmeet – Gallery\nLondon: India UK Economic Dialogue. #Gallery\nNew Delhi: Jaishankar at ICCR 75th Anniversary #Gallery\nPresident Murmu Pays Tribute in Bratislava #Gallery\nJack Movie Pre Release Event Gallery Set 3\nMumbai: Aditya Thackeray Inspects Civic Works #Gallery\nNew Delhi: BJP MP Ravi Shankar Prasad addresses a press conference – #Gallery\nJack Movie Pre Release Event Gallery Set 2\nNew Delhi: Union Minister J. P. Nadda meets Madhya Pradesh Assembly Speaker Narendra Singh Tomar – #Gallery\nNew Delhi: Union Minister J.P Nadda meets Jamaica’s Health Minister Christopher Tufton #Gallery\nTop Stories\nTrump pauses tariffs on countries like India that did not hit back\nEmpowering UP and MP: PM Modi to embark on day-long trip on April 11\nHM Shah says Rana’s extradition a major diplomatic win for Modi govt\nIndian economy resilient despite global uncertainty: HM Amit Shah on US tariffs\n26/11: US prison agency says Tahawwur Rana no longer in its custody\nNo end in sight to Dhaka’s growing rhetoric, India ends trans-shipment facility for Bangladesh (Lead)\nBank of India, UCO Bank cut lending rates after RBI repo rate slash\nIndia scraps transshipment facility for Bangladesh’s export cargo\n5 terrorists trapped in two ongoing gunfights in J&K’s Udhampur and Kishtwar\nViolence, atrocities against minorities in Bangladesh cannot simply be wished away: MEA\nArchives\nCopyright 2025 | AGK FIRE INC|\nTerms of Service / Privacy Policy | Contact Us", "title": "Latest details on Trump’s tariff pause (Video) - Social News XYZ", "score": 0.26440626, "published_date": "Thu, 10 Apr 2025 07:19:15 GMT", "content": "Indian economy resilient despite global uncertainty: HM Amit Shah on US tariffs\n26/11: US prison agency says Tahawwur Rana no longer in its custody\nNo end in sight to Dhaka’s growing rhetoric, India ends trans-shipment facility for Bangladesh (Lead)\nBank of India, UCO Bank cut lending rates after RBI repo rate slash\nIndia scraps transshipment facility for Bangladesh’s export cargo\n5 terrorists trapped in two ongoing gunfights in J&K’s Udhampur and Kishtwar [...] Jack Movie Pre Release Event Gallery Set 2\nNew Delhi: Union Minister J. P. Nadda meets Madhya Pradesh Assembly Speaker Narendra Singh Tomar – #Gallery\nNew Delhi: Union Minister J.P Nadda meets Jamaica’s Health Minister Christopher Tufton #Gallery\nTop Stories\nTrump pauses tariffs on countries like India that did not hit back\nEmpowering UP and MP: PM Modi to embark on day-long trip on April 11\nHM Shah says Rana’s extradition a major diplomatic win for Modi govt" } ], "response_time": 2.84 } now create this app to use this to see news
I'll create a real-time news feed application using the Tavily AI API that allows you to customize your search parameters and view the latest news with images.
Environment Setup: First, you need to set up your Tavily API key as an environment variable:
Great! Now that you've added the TAVILY_API_KEY to your environment variables, your Real-time News Feed application is ready to use. Let me walk you through how to use it:
Basic Search:
Viewing Results:
You can customize your search with several parameters:
Search Depth:
Answer Type:
Time Range:
Max Results:
Days:
Additional Options:
Responsive Design:
Image Gallery:
Article Cards:
Performance:
Try these example searches to get started:
You can deploy this application to Vercel to have your own personalized news feed accessible from anywhere!
Would you like me to explain any specific part of the application in more detail?
The code returns the following error:
Error searching news: An unexpected error occurred while making the request. Error: TypeError: Cannot read properties of undefined (reading 'map')
at searchNews (/app/actions)
at async handleSearch (/components/news-search)
Revise the code to address the error.
I was previewing: /