In today's data-driven world, enriching your applications with accurate, real-time business information is no longer a luxury—it's a necessity. Whether you're building a next-gen CRM, automating B2B onboarding, or performing risk assessment, access to verifiable company data is critical. The challenge? Sourcing this data is often complex, expensive, and slow.
Enter businesses.do, an AI-powered API designed to deliver comprehensive business intelligence on-demand. Forget cumbersome data files and outdated records. With a simple API call, you can fetch detailed company profiles, financials, corporate structures, and even perform a D-U-N-S lookup.
This quickstart guide will show you just how easy it is to integrate this powerful tool into your Python application. In less than 10 minutes, you'll be able to retrieve rich data for any business worldwide.
Before we dive into the code, let's look at what makes businesses.do the ideal solution for developers:
First things first, you'll need an API key. Head over to businesses.do to sign up and get your unique key. Keep it handy for the next step.
We'll use the popular requests library to communicate with the API. If you don't have it installed, open your terminal and run the following command. It's also a best practice to work within a virtual environment.
# Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
# Install the requests library
pip install requests
Now for the fun part. Create a new Python file (e.g., lookup.py) and paste the code below. Replace 'YOUR_API_KEY' with the key you obtained in Step 1.
This script will search for a company named "Example Corp" in the USA.
import requests
import json
import os
def get_company_data(company_name: str, country_code: str):
"""
Fetches company data from the businesses.do API.
"""
# It's best practice to store your API key as an environment variable
# For this example, we'll hardcode it.
# api_key = os.getenv("BUSINESSES_DO_API_KEY")
api_key = "YOUR_API_KEY"
if not api_key:
print("Error: API key not found. Set the BUSINESSES_DO_API_KEY environment variable.")
return
# The API endpoint for company lookups
url = "https://api.businesses.do/v1/lookup"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
params = {
"name": company_name,
"country": country_code
}
try:
response = requests.get(url, headers=headers, params=params)
response.raise_for_status() # Raises an HTTPError for bad responses (4xx or 5xx)
data = response.json()
print("Successfully retrieved data:")
print(json.dumps(data, indent=2))
return data
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err}")
except Exception as err:
print(f"An other error occurred: {err}")
if __name__ == "__main__":
# Perform a lookup for "Example Corp" in the USA
get_company_data(company_name="Example Corp", country_code="USA")
Run the script from your terminal:
python lookup.py
If the request is successful, you will see a beautifully formatted JSON object printed to your console, similar to this:
{
"status": "success",
"company": {
"name": "Example Corp",
"dunsNumber": "123-456-7890",
"legalStatus": "Active",
"address": {
"street": "123 Innovation Drive",
"city": "Palo Alto",
"state": "CA",
"zipCode": "94304",
"country": "USA"
},
"industry": {
"naicsCode": "511210",
"description": "Software Publishers"
},
"employeeCount": 500,
"annualRevenue": {
"value": 150000000,
"currency": "USD"
},
"yearFounded": 2010
}
}
Let's break down what this gives you:
You've just scratched the surface. With this data integrated, you can:
Integrating a world-class business intelligence API into your Python projects doesn't have to be a major undertaking. As you've seen, businesses.do provides a simple, developer-friendly way to query comprehensive global company data in minutes.
Ready to empower your applications with verifiable data? Get your free API key from businesses.do and start building today