The Typescript SDK allows for easy interaction with the Linkup API, offering the full range of our search functionality. Easily integrate smart search capabilities into your applications, harnessing Linkup’s powerful search features.
You can use our playground to have interactive examples and see how to implement them with the SDK.
Here is a basic usage showing how to use the Linkup SDK:
Copy
Ask AI
import { LinkupClient } from "linkup-sdk";const client = new LinkupClient({ apiKey: "<YOUR API KEY>",});const askLinkup = async () => { return await client.search({ query: "Can you tell me which women were awared the Physics Nobel Prize", depth: "standard", outputType: "sourcedAnswer", });};askLinkup().then(console.log);
The query parameter is the core input string that defines your search intent. It represents the question or information request that you want Linkup to answer. How you formulate this query significantly impacts the quality and relevance of results.
Effective queries should be:
Clear and specific: “What were the key findings of NASA’s James Webb telescope in 2023?” provides better results than “Tell me about space discoveries”
Contextually rich: Include relevant context when needed (“What are the environmental impacts of lithium mining for EV batteries?”)
Naturally phrased: Write as you would ask a knowledgeable person, not with keywords
For optimal results, consider reviewing our prompting guide, which provides detailed strategies for crafting effective queries.
The depth field is used to select the type of search you want to perform:
standard: the search will be straightforward and fast, suited for relatively simple queries (e.g. “What’s the weather in Paris today?”)
depth: the search will use an agentic workflow, which makes it in general slower, but it will be able to solve more complex queries (e.g. “What is the company profile of LangChain accross the last few years, and how does it compare to its concurrents?”)
sourcedAnswer: Provides a comprehensive natural language answer to the query along with citations to the source material. Ideal for when you need well-formed responses with verifiable information and transparent sourcing.
searchResults: Returns the raw search context data without synthesis, giving you direct access to the underlying information. Useful for custom processing, or when you need to implement your own answer generation logic.
structured: Allows you to receive responses in a custom format based on the format provided in
structuredOutputSchema. If you want a full guide on how to use it, you check it here
Linkup’s structured output feature allows you to receive responses in a custom format that you define. This is particularly useful when you need to integrate Linkup’s responses directly into your application’s data structure or when you want to ensure consistency in the response format.
To do that, you have to use the structuredOutputSchema field.
If you want a full guide on how to use it, you check it here
The includeImages parameter allows you to receive image results alongside text results in your search responses. When set to true, Linkup will return relevant images related to your query, each with a URL and metadata. This is particularly useful for:
Creating visual search experiences
Building content that combines text and images
Researching topics where visual information is important
Image results are returned with the same structure as text results but with type: "image".
The toDate parameter complements fromDate by restricting search results to only include content published or updated before the specified date. This is useful for:
Historical research on specific time periods
Analyzing content published within a specific date range
Avoiding more recent information that might skew results
Like fromDate, the date should be a Date type, for example: new Date("2024-12-31").
When used together, fromDate and toDate create a date range filter for your search results.
This example show you how to combine the standard search with a sourced answer
Copy
Ask AI
import { LinkupClient } from 'linkup-sdk';const client = new LinkupClient({ apiKey: 'YOUR_API_KEY',});const getRaceResume = async () => { return await client.search({ query:"Can you resume me the last Formula 1 race ?", depth:"standard", outputType:"sourcedAnswer", });};getRaceResume().then(console.log);
Example response:
Copy
Ask AI
{ "answer": "Lando Norris won the 2025 Australian Grand Prix, the season opener, in challenging wet conditions. The race saw multiple incidents, including crashes on the first lap, leading to six drivers not finishing. Notably, Lewis Hamilton finished in 10th place. The race was marked by dramatic weather changes that affected many competitors. For more details, you can read the full results [here](https://www.motorsportweek.com/2025/03/16/f1-2025-australian-grand-prix-race-results/).", "sources": [ { "name": "F1 2025 Australian Grand Prix – Race Results", "url": "https://www.motorsportweek.com/2025/03/16/f1-2025-australian-grand-prix-race-results/", "snippet": "McLaren's Lando Norris has won the Formula 1 season-opening Australian Grand Prix in a mixed conditions thriller at the Albert" }, { "name": "McLaren’s Lando Norris wins wet and wild Australian Grand Prix. Hamilton finishes 10th", "url": "https://www.msn.com/en-us/sports/other/mclarens-lando-norris-wins-wet-and-wild-australian-grand-prix-hamilton-finishes-10th/ar-AA1B0kIf", "snippet": "The Melbourne race had a thrilling start with Racing Bull’s Isack Hadjar out on the formation lap, and Alpine’s Jack Doohan and Williams’ Carlos Sainz crashing out on the opening lap." }, { "name": "F1 Australian Grand Prix 2025 results: Norris wins, rookies spin out in the rain", "url": "https://www.msn.com/en-us/sports/other/f1-australian-grand-prix-2025-results-norris-wins-rookies-spin-out-in-the-rain/ar-AA1B4irD", "snippet": "If you like drama in racing, the 2025 F1 Australian Grand Prix didn’t disappoint. Intermittent rain caused havoc on the track, and six drivers didn’t complete the 57 laps, including four of this year’s full-season rookies." }, { "name": "F1 2025 schedule: Full race calendar, round dates for Formula One season", "url": "https://www.msn.com/en-us/sports/other/f1-2025-schedule-full-race-calendar-round-dates-for-formula-one-season/ar-AA1B0AkZ", "snippet": "Formula 1 campaign is officially underway.There has been criticism of F1's geographical planning of races in recent years, so efforts have been made this season to create a more logical and environmentally sustainable calendar." }, { "name": "Formula 1 in 2025: How to watch the Australian Grand Prix on TV and what to know", "url": "https://www.msn.com/en-us/sports/other/formula-1-in-2025-how-to-watch-the-australian-grand-prix-on-tv-and-what-to-know/ar-AA1AJMQd", "snippet": "Get ready for the Australian Grand Prix with a guide that tells you everything you need to know about how to watch the year's first Formula 1 race, what the schedule is and more." }, { "name": "The 2025 Formula 1 Season Is Here. Here’s Everything You Need to Know.", "url": "https://robbreport.com/motors/cars/2025-formula-1-season-preview-1236361696/", "snippet": "Formula 1 season starts Sunday with the Australian Grand Prix, and the drama and adrenaline of the 24-race is ready to redline." }, { "name": "Formula 1 2025", "url": "https://www.channel4.com/4viewers/blog/formula-1-2025", "snippet": "Formula 1 travels to China, where the first Sprint race of the 2025 season takes place ... for highlights of the Chinese Grand Prix. Last year, Max Verstappen dominated around the Shanghai ..." }, { "name": "F1 2025 preview: How to watch, schedule, teams, drivers, title favorites", "url": "https://www.usatoday.com/story/sports/motor/formula1/2025/03/13/f1-2025-schedule-how-to-watch-preview-odds/82323048007/", "snippet": "After a thrilling finish to the 2024 world championship season, Formula 1 is back in action starting this weekend in Melbourne with the Australian Grand Prix. Last ... for race wins once again." }, { "name": "F1 2025 season: Full calendar, testing and race schedule, driver line-ups, rules, how to watch, what's new", "url": "https://www.skysports.com/f1/news/12433/13292832/f1-2025-season-full-calendar-testing-and-race-schedule-driver-line-ups-rules-how-to-watch-whats-new", "snippet": "All you need to know about Formula 1 in ... on March 14-16 as part of a rejigged 24-race calendar, which does not feature any new events. Bahrain has hosted the opening race for the last four ..." }, { "name": "Formula 1 2025 season preview and predictions: Leclerc could be the one to stop Verstappen's run", "url": "https://www.racingpost.com/sport/motor-sports-tips/formula-1-tips/formula-1-2025-season-predictions-and-betting-tips-a4eYr9M8WFXb/", "snippet": "You might not guess it from the final points table, but the 2024 Formula 1 season was the most open for decades ... the fight for the constructors’ championship on the last lap of the last race. Charles Leclerc enjoyed his strongest season, with ..." } ]}
Company Revenue
Deep + structured output
This example shows you how to use the deep with a relative complexe structured output:
Copy
Ask AI
import { LinkupClient } from 'linkup-sdk';const client = new LinkupClient({ apiKey: 'YOUR_API_KEY',});const schema = { "type": "object", "properties": { "companyName": { "type": "string", "description": "The name of the company" }, "revenueAmount": { "type": "number", "description": "The revenue amount" }, "fiscalYear": { "type": "string", "description": "The fiscal year for this revenue" } }};const getCompanyRevenue = async () => { return await client.search({ query: "What is Microsoft's 2024 revenue?", depth: 'deep', outputType: 'structured', structuredOutputSchema: schema });};getCompanyRevenue().then(console.log);
This example shows you how to use the standard with a search results:
Copy
Ask AI
import { LinkupClient } from 'linkup-sdk';const client = new LinkupClient({ apiKey: 'YOUR_API_KEY',});const getNews = async () => { return await client.search({ query: "Latest politic news", depth: 'standard', outputType: 'searchResults' });};getNews().then(console.log);
Example response:
Copy
Ask AI
{ "results": [ { "type": "text", "name": "‘I’m Still Here’ invites reflection on world politics, history", "url": "https://www.thepostathens.com/article/2025/03/im-still-here-movie-review", "content": "For “I’m Still Here,” viewers do not walk away with the same feeling. It begins with excitement and energy but ends feeling empty and reflective. It is a movie about memory and the ability to keep the ones we’ve lost alive in our psyches." }, { "type": "text", "name": "Local Politics", "url": "https://www.seattletimes.com/seattle-news/politics/", "content": "House Bill 1175 would have required cities across Washington to allow cafes and stores in all residential areas, superseding any local zoning restrictions. Initiative 2081, signed by over 448,000 ..." }, { "type": "text", "name": "Spruce Creeker allegedly points gun at fellow resident over politics", "url": "https://www.villages-news.com/2025/03/17/spruce-creeker-allegedly-points-gun-at-fellow-resident-over-politics/", "content": "A resident of the Spruce Creek Del Webb community in Summerfield was arrested after he allegedly pointed a gun at a fellow resident over politics." }, { "type": "text", "name": "U.S. Politics", "url": "https://www.newsweek.com/topic/u.s.-politics", "content": "Senate Minority Leader Chuck Schumer has now announced he is in fact planning to back the stopgap bill. Newsweek's live blog is closed." }, { "type": "text", "name": "Nevada Politics", "url": "https://lasvegassun.com/news/politics/", "content": "Tariffs on imported goods are the known unknown in the Clark County School District’s offices of construction and facilities management. Those are the offices responsible for the upkeep ..." }, { "type": "text", "name": "VIRGINIA POLITICS", "url": "https://www.washingtonpost.com/local/virginia/politics/", "content": "Virginia Superintendent of Public Instruction Lisa Coons has resigned, marking the second departure from the role under Gov. Glenn Younkin. Anderson’s move, coupled with the Democratic Party’s ..." }, { "type": "text", "name": "BSc Politics and Philosophy", "url": "https://www.lse.ac.uk/study-at-lse/undergraduate/bsc-politics-and-philosophy", "content": "You won’t simply study politics and philosophy side by side. You’ll see how each subject helps us understand political practices and behaviour and the development of political ideals. This includes examining public policies from the perspective of ..." }, { "type": "text", "name": "The NPR Politics Podcast", "url": "https://www.npr.org/podcasts/510310/npr-politics-podcast", "content": "Every weekday, NPR's best political reporters are there to explain the big news coming out of Washington and the campaign trail. They don't just tell you what happened. They tell you why it matters." }, { "type": "text", "name": "About RealClearPolitics", "url": "https://www.realclearpolitics.com/about.html", "content": "With this realization, John and Tom set out to create an online clearinghouse tailored to consumers of news and information on U.S. politics, policy, and elections. Despite a shared passion for ..." }, { "type": "text", "name": "Georgia Politics", "url": "https://www.fox5atlanta.com/tag/politics/ga-politics", "content": "A prominent plaza in Washington, D.C., dedicated to the Black Lives Matter (BLM) movement, is undergoing major changes as crews began dismantling the site this week. The results are in for the ..." } ]}
{ "results": [ {"type":"text","name":"The rough road to sustainable farming in an Amazon deforestation hotspot","url":"https://www.msn.com/en-us/society-culture-and-history/social-issues/the-rough-road-to-sustainable-farming-in-an-amazon-deforestation-hotspot/ar-AA1B64yY","content":"Bartolomeu Moraes, better known as Brasília, was a peasant leader and trade unionist in Brazil involved in a long, bloody land war. In 2002, he was killed after years of opposing powerful local ranchers along the BR-163 highway area,"}, {"type":"text","name":"Forest management ambitions in Brazilian Amazon aim to make up for lost time","url":"https://www.msn.com/en-us/news/world/forest-management-ambitions-in-brazilian-amazon-aim-to-make-up-for-lost-time/ar-AA1ALyxz","content":"In the early 2000s, deforestation levels in the Brazilian Amazon rose so tremendously that, faced with both national and international pressure, the federal government decided to implement forest timber management as a way to curb the destruction."}, {"type":"text","name":"Race to save the rainforest: Why replacing cocaine barons with cattle ranchers is destroying the Amazon","url":"https://www.telegraph.co.uk/news/amazon-deforestation-in-colombia/","content":"Though the Amazon rainforest proved a useful screen ... Should the recent rates of deforestation continue, experts warn, the implications will prove devastating for us all. Marisela Silva Parra ..."}, {"type":"text","name":"Thousands of acres of Amazon rainforest cleared for climate summit highway in Brazil","url":"https://www.msn.com/en-us/news/world/thousands-of-acres-of-amazon-rainforest-cleared-for-climate-summit-highway-in-brazil/ar-AA1AQQ04","content":"A BBC report found on Wednesday that tens of thousands of acres of protected Amazonian rainforest are being cleared ahead of the COP30 climate summit in Brazil."}, {"type":"text","name":"The Environmental Cost of Amazon Highways to Host COP30: The dilemma of Sustainability Goals vs Amazon Destruction","url":"https://www.ghanaweb.com/GhanaHomePage/features/The-Environmental-Cost-of-Amazon-Highways-to-Host-COP30-The-dilemma-of-Sustainability-Goals-vs-Amazon-Destruction-1975596","content":"The Amazon rainforest, often referred to as the 'lungs of the Earth,' plays a crucial role in global climate regulation by absorbing vast amounts of carbon dioxide and producing oxygen."}, {"type":"text","name":"Carlos Nobre on tipping points in the Amazon rainforest","url":"https://thebulletin.org/premium/2025-03/carlos-nobre-on-tipping-points-in-the-amazon-rainforest/","content":"For roughly about 65 million years, the forests of the Amazonian were resilient to changes in the climate. But that is changing rapidly, as the region is exposed to unprecedented stress from global warming,"}, {"type":"image","name":"Deforestation: Primary Forest Losses Impact Climate Change — Carmen ...","url":"https://images.squarespace-cdn.com/content/v1/584738ff20099e6c2da92f74/1556207140784-08HFC1PNAYWX368IJGXM/ke17ZwdGBToddI8pDm48kNvT88LknE-K9M4pGNO0Iqd7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z5QPOohDIaIeljMHgDF5CVlOqpeNLcJ80NK65_fV7S1USOFn4xF8vTWDNAUBm5ducQhX-V3oVjSmr829Rco4W2Uo49ZdOtO_QXox0_W7i2zEA/Deforestation+in+Brazil"}, {"type":"image","name":"Amazon Rainforest Deforestation Before And After","url":"https://media.wired.com/photos/59372bbfd80dd005b42b626f/master/w_2560%2Cc_limit/AP4997094644081.jpg"}, {"type":"image","name":"11 Amazon Rainforest Deforestation Facts to Know About | Earth.Org","url":"https://u4d2z7k9.rocketcdn.me/wp-content/uploads/2021/11/Untitled-design-88.jpg"}, {"type":"image","name":"Deforestation Before And After Amazon Rainforest","url":"https://idsb.tmgrup.com.tr/ly/uploads/images/2020/07/10/45806.jpg"}, {"type":"image","name":"Deforestation In The Amazon Rainforest | emr.ac.uk","url":"https://en.mercopress.com/data/cache/noticias/73326/0x0/1-88.jpg"}, {"type":"image","name":"√100以上 amazon rainforest deforestation rate per day 269464-Amazon ...","url":"https://static01.nyt.com/images/2020/06/07/world/07amazon-bw/06amazon-mediumSquareAt3X.jpg"},{"type":"image","name":"Amazon Forest Deforestation","url":"https://infoamazonia.org/wp-content/uploads/2022/02/50224578572_2b105d3b5e_o.jpg"},{"type":"image","name":"Beneath the Wisteria: The Horrifying Science of the Deforestation ...","url":"https://media.wired.com/photos/5d6027925af21f000859fc13/master/w_2000,c_limit/Science_AmazonASAP_1125307709.jpg"},{"type":"image","name":"Deforestation in Brazil is rising again — after years of decline - Vox","url":"https://cdn1.vox-cdn.com/thumbor/dmZLKnfH2zl9uLLzyxti1yWEfO0=/cdn0.vox-cdn.com/uploads/chorus_asset/file/2373910/184252072.0.jpg"}, {"type":"image","name":"Brazil: Rate of deforestation in Amazon rainforest at highest level in ...","url":"https://www.dynamitenews.com/images/2019/11/20/brazil-rate-of-deforestation-in-amazon-rainforest-at-highest-level-in-11-years/ifA0r86KFZ0Ju1tlmvCSPbrfqnvBkVNfIozgNWEl.jpeg"}, {"type":"image","name":"Amazon deforestation leaps 16 percent in 2015 | Inhabitat - Green ...","url":"https://inhabitat.com/wp-content/blogs.dir/1/files/2015/11/amazon-deforestation02.jpg"}, ]}
AI Avancements
Dates filtering
This example shows you how to use the dates filter:
Copy
Ask AI
import { LinkupClient } from 'linkup-sdk';const client = new LinkupClient({ apiKey: 'YOUR_API_KEY',});const getNews = async () => { return await client.search({ query: "What are the recent advancements in artificial intelligence technology", "depth": "standard", "outputType": "sourcedAnswer", "fromDate": new Date("2025-03-01"), "toDate": new Date("2025-03-05"), });};getNews().then(console.log);
Example response:
Copy
Ask AI
{ "answer":"1. **MBZUAI Launches AI Undergraduate Program**: The Mohamed bin Zayed University of Artificial Intelligence has introduced a pioneering undergraduate program aimed at shaping future AI leaders. [Read more](https://www.finanznachrichten.de/nachrichten-2025-03/64714165-mbzuai-unveils-first-of-its-kind-undergraduate-program-in-artificial-intelligence-designed-to-empower-future-ai-leaders-200.htm)\n\n2. **DeepSeek AI Chatbot Raises Cybersecurity Concerns**: The release of DeepSeek, an AI chatbot, has sparked discussions about new cybersecurity challenges associated with rapidly advancing AI technologies. [Read more](https://www.law.com/newyorklawjournal/2025/03/04/deepseek-sparks-new-cyber-challenges-in-the-ai-chatbot-era/)\n\n3. **AI's Impact on Business Innovation**: The integration of AI and other technologies is becoming essential for business success, driving innovation and growth. [Read more](https://www.independent.com.mt/articles/2025-03-02/newspaper-opinions/The-intersection-of-technology-and-business-Paving-the-way-for-innovation-and-growth-6736268254)\n\n4. **Research on Achieving Human-Level AI**: Experts are calling for a change in approach to develop AI systems capable of human-level reasoning, indicating current methods may not suffice. [Read more](https://www.nature.com/articles/d41586-025-00649-4)", "sources": [ { "name":"MBZUAI Unveils First-of-its-Kind Undergraduate Program in Artificial Intelligence Designed to Empower Future AI Leaders", "url":"https://www.finanznachrichten.de/nachrichten-2025-03/64714165-mbzuai-unveils-first-of-its-kind-undergraduate-program-in-artificial-intelligence-designed-to-empower-future-ai-leaders-200.htm", "snippet":"ABU DHABI, AE / ACCESS Newswire / March 3, 2025 / The Mohamed bin Zayed University of Artificial Intelligence (MBZUAI) is disrupting the AI education landscape with the launch of its first-ever underg" }, { "name":"The intersection of technology and business: Paving the way for innovation and growth", "url":"https://www.independent.com.mt/articles/2025-03-02/newspaper-opinions/The-intersection-of-technology-and-business-Paving-the-way-for-innovation-and-growth-6736268254", "snippet":"In the fast-paced world of business, the integration of innovative technologies has become a crucial driver of success. As an advocate for Artificial Intelligence (AI), Blockchain, Data Analytics, and" }, { "name":"DeepSeek Sparks New Cyber Challenges In the AI Chatbot Era", "url":"https://www.law.com/newyorklawjournal/2025/03/04/deepseek-sparks-new-cyber-challenges-in-the-ai-chatbot-era/", "snippet":"This article discusses DeepSeek, an artificial intelligence chatbot that was released in January of this year, and the concerns it raises around security and rapidly advancing technology." }, { "name":"Prediction: 2 Artificial Intelligence (AI) Stocks That Will Be Worth More Than Palantir by 2026", "url":"https://www.fool.com/investing/2025/03/02/prediction-2-artificial-intelligence-ai-stocks-tha/", "snippet":"and one of its biggest driving force has been the artificial intelligence (AI) industry. Recent advances have led to a lot of investor excitement about the potential for the technology to change ..." }, { "name":"How Technology is Changing Our Everyday Life: From AI to the Internet of Things", "url":"https://signalscv.com/2025/03/how-technology-is-changing-our-everyday-life-from-ai-to-the-internet-of-things/", "snippet":"Technology has revolutionized our lives, transforming how we communicate, work, shop, and even unwind. In a world driven by rapid innovation, technologies like artificial intelligence (AI), the Internet of Things" }, { "name":"How AI can achieve human-level intelligence: researchers call for change in tack", "url":"https://www.nature.com/articles/d41586-025-00649-4", "snippet":"Artificial intelligence (AI) systems with human-level reasoning are unlikely to be achieved through the approach and technology ... Heights, New York, who spearheaded the survey in her role as president of the Association for the Advancement of Artificial ..." } ]}
We strongly recommend you to read our prompting guide to best prompt the Linkup API and get optimal results. Even small improvements in how you structure your prompts can dramatically enhance the quality of responses and the overall user experience.
We strongly recommend you to read our structured output guide to ensure consistency in the response format. Mastering structured outputs allows you to fully leverage Linkup’s capabilities while maintaining complete control over how the information is presented and processed in your application.