Company Descriptions Generator
Building a tool to generate rich company descriptions using Linkup API
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
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.
Install the SDK
Next, let’s install the Linkup SDK in your preferred language:
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.
Create the Query Generator
Create a function to generate the search query:
Complete Implementation
Here’s the complete implementation that puts everything together:
How It Works
The company description generator works in three main steps:
- Input Processing: The tool takes a company name and country as input and cleans them.
- Query Generation: It creates a search query that includes both the company name and country to improve search accuracy.
- 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.
Facing issues? Reach out to our engineering team at support@linkup.so or via our Discord.