Skip to main content
In this tutorial, you’ll learn how to build a real-time company intelligence system that automatically gathers and structures information about any company. This system is perfect for sales teams, market researchers, and anyone needing up-to-date company information.

Prerequisites

Before starting, ensure you have:
  • Python 3.7 or newer installed
  • Basic familiarity with Python programming
  • A Linkup API key (required for making requests)

Get your API key

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

Project setup

Let’s start by creating a new project and installing the necessary dependencies:
shell

Implementation guide

1. Define your data structure

First, we’ll create a data model that specifies exactly what company information we want to collect. Create a new file called schema.py:
python
This schema ensures our data is consistently structured and validated.

2. Build the intelligence engine

Next, create company_intel.py to handle the core functionality:
python

3. Create the API layer

Now let’s make our intelligence engine accessible via HTTP. Create api.py:
python

Using the system

Basic usage example

At first, let’s use the intelligence engine directly in Python. We will create a new file called main.py and add the following code to it:
python

Get your API key

Create a Linkup account for free to get your API key.
You can run the code by executing the following command:
shell

Running the API server

Let’s now try our API server.
shell
You can now access the API at http://localhost:8000/docs.

Step 1

Click on the endpoint GET /company/{name}, and click on the Try it out button. Step 1

Step 2

Step 2 Now, enter the company name, for example Vercel, and click on the Execute button.

Step 3

Step 3

Step 4

You should see the response in JSON format. Step 4

Response examples

Successful response

A typical successful request to /company/Vercel returns:

Error responses

The API returns appropriate error responses in these situations:

Company not found

Invalid API key

Rate limit exceeded

Engine response fields

Best practices

For production use, consider implementing these best practices:
  1. Error handling
    • Implement comprehensive error handling for API calls
    • Log errors appropriately
    • Provide meaningful error messages to users
  2. Rate limiting
    • Implement rate limiting to avoid API quota issues
    • Consider using a queue for batch processing
    • Add retry logic for failed requests
  3. Caching
    • Cache frequently requested company data
    • Use appropriate TTL values based on data freshness requirements
    • Implement cache invalidation strategies
  4. Data validation
    • Validate all input data
    • Use Pydantic’s validation features
    • Implement data cleaning where necessary

Common applications

This system can be used for:
  • Pre-sales research automation
  • CRM data enrichment
  • Competitor monitoring
  • Market intelligence gathering
  • Investment research
  • Due diligence automation

Conclusion

You now have a company intelligence engine that provides:
  • Real-time company information
  • Structured, consistent data
  • Easy API access
  • Extensible architecture
Remember to:
  • Keep your API key secure
  • Respect API rate limits
  • Implement appropriate caching for your use case
  • Add error handling for production use
Need help? Email support@linkup.so, ping us on Discord, or talk to us.