Overview

This guide will show you how to integrate Linkup API into your Lovable applications, whether you’re starting from scratch or adding Linkup to an existing app.

Integration Steps

1

Access your Lovable account

Log in to your Lovable account at lovable.dev.

3

Add Linkup to Your Lovable App

In your Lovable chatbot window, use the prompt below:

# Install the Linkup SDK
npm i linkup-sdk

# Import and initialize the client
import { LinkupClient } from 'linkup-sdk';

const client = new LinkupClient({
  apiKey: '<YOUR API KEY>', # your api key here
});

# Create the search function
const askLinkup = async () => {
  return await client.search({
    query: "Your Query here",
    depth: 'standard', # "standard" or "deep"
    outputType: 'sourcedAnswer',
  });
};

# Call the function
askLinkup().then(console.log);
ParameterOptionsDescription
depthstandard, deepControls search depth. deep performs more thorough research, standard is faster.
output_typesearchResults, sourcedAnswer, structuredDetermines the format of returned information.
4

Start Building Your Web-Connected App

Now that you have Linkup integrated with Lovable, you can start building applications that have access to the entire web. Your Lovable app can now:

  • Search and retrieve real-time information from across the web
  • Provide up-to-date answers with source citations
  • Access and analyze web content to enhance user interactions

Start by testing your integration with a simple query, then expand your application’s capabilities using the advanced configuration options below.

For advanced configuration like including images, date filtering and supported output types, check configuration parameters .

Best Practices

  1. API Key Security: Never expose your API key in client-side code. Use environment variables or secure backend storage.

  2. Error Handling: Implement proper error handling for API calls:

const askLinkup = async () => {
  try {
    const result = await client.search({
      query: "Your query here",
      depth: 'deep',
      outputType: 'sourcedAnswer',
    });
    return result;
  } catch (error) {
    console.error('Error fetching data from Linkup:', error);
    // Handle error appropriately
  }
};
  1. Rate Limiting: Be mindful of API rate limits and implement appropriate caching strategies if needed.

Next Steps

Facing issues? Reach out to our engineering team at support@linkup.so or via our Discord.