Skip to main content
This tutorial will show you how to build a company description generator that takes a company name and country as input and returns comprehensive information about the company using the Linkup API’s structured output feature.

What we’re building

Our company description generator will:
  • Take a company name and country as input
  • Use Linkup API to search for information about the company
  • Return structured data about the company (description, industry, size, location, etc.)

Building the generator

1

Define the Schema

Before we start coding, let’s define the schema that specifies what information we want to extract about companies. This schema will be used throughout our implementation:
This schema defines all the fields we want to extract about a company. The required fields are name, description, and industry, while the rest are optional but provide valuable additional information.
2

Install the SDK

Next, let’s install the Linkup SDK in your preferred language:
3

Set Up the Client

Initialize the Linkup client with your API key:

Get your API key

Create a Linkup account for free to get your API key.
4

Create the Query Generator

Create a function to generate the search query:
5

Complete Implementation

Here’s the complete implementation that puts everything together:

How it works

The company description generator works in three main steps:
  1. Input processing: the tool takes a company name and country as input and cleans them.
  2. Query generation: it creates a search query that includes both the company name and country to improve search accuracy.
  3. Structured output: uses Linkup’s structured output feature with a comprehensive schema to ensure consistent, well-formatted results.

Possible enhancements

For a production version, consider adding:
  • Add as much information you have about companies in the queries, to limit ambiguity about which company you are searching for.
  • Implement rate limiting and error handling for API usage.
  • Batch processing to search for multiple companies in parallel if you are enriching a dataset for example.
Need help? Email support@linkup.so, ping us on Discord, or talk to us.