Using the ZoomInfo API to Get Companies (with Python examples)

by Endgrate Team 2024-08-12 4 min read

ZoomInfo homepage

Introduction to ZoomInfo API

ZoomInfo is a powerful business intelligence platform that provides comprehensive data on companies and professionals. It offers valuable insights that help businesses enhance their marketing, sales, and recruitment strategies by providing access to detailed company profiles, contact information, and market trends.

Developers may want to integrate with the ZoomInfo API to access and manage company data efficiently. For example, a developer could use the ZoomInfo API to retrieve detailed information about potential business partners or competitors, enabling data-driven decision-making and strategic planning.

Setting Up Your ZoomInfo Test Account

Before you can start using the ZoomInfo API to retrieve company data, you'll need to set up a test or sandbox account. This will allow you to safely experiment with the API without affecting live data.

Create a ZoomInfo Developer Account

To begin, you'll need to sign up for a ZoomInfo developer account. Visit the ZoomInfo API documentation to find the registration link. Follow the instructions to create your account. If you already have an account, simply log in.

Generate API Credentials

Once your account is set up, you'll need to generate API credentials to authenticate your requests. ZoomInfo uses a custom authentication method, so follow these steps to obtain your credentials:

  • Navigate to the API section of your ZoomInfo account dashboard.
  • Locate the option to create a new API key or token.
  • Follow the prompts to generate your client ID and client secret.
  • Store these credentials securely, as you'll need them to authenticate your API requests.

Configure OAuth for ZoomInfo API

ZoomInfo API requires OAuth-based authentication. Here's how to set it up:

  1. In your ZoomInfo developer account, go to the OAuth settings page.
  2. Create a new OAuth app by providing necessary details such as app name and redirect URL.
  3. Once created, note down the client ID and client secret provided by ZoomInfo.
  4. Use these credentials to obtain an access token by following the OAuth flow outlined in the documentation.

With your test account and API credentials ready, you can now proceed to make API calls to ZoomInfo and explore its capabilities.

ZoomInfo authentication documentation page.
sbb-itb-96038d7

Making API Calls to ZoomInfo Using Python

To interact with the ZoomInfo API and retrieve company data, you'll need to use Python, a versatile programming language known for its simplicity and readability. This section will guide you through setting up your environment and making API calls to ZoomInfo.

Setting Up Your Python Environment for ZoomInfo API

Before you start coding, ensure you have the following prerequisites installed on your machine:

  • Python 3.11.1
  • The Python package installer, pip

Once you have these installed, open your terminal or command prompt and install the requests library, which will help you make HTTP requests:

pip install requests

Example Code to Retrieve Companies from ZoomInfo API

Now that your environment is set up, you can write a Python script to make a GET request to the ZoomInfo API and retrieve company data. Create a file named get_zoominfo_companies.py and add the following code:

import requests

# Set the API endpoint and headers
endpoint = "https://api.zoominfo.com/companies"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer Your_Access_Token"
}

# Make a GET request to the API
response = requests.get(endpoint, headers=headers)

# Check if the request was successful
if response.status_code == 200:
    # Parse the JSON data from the response
    data = response.json()
    # Loop through the companies and print their information
    for company in data["companies"]:
        print(company)
else:
    print(f"Failed to retrieve companies: {response.status_code} - {response.text}")

Replace Your_Access_Token with the access token you obtained from the OAuth setup.

Running the Python Script and Verifying Results

Run the script from your terminal or command line using the following command:

python get_zoominfo_companies.py

If successful, you should see a list of companies printed in your terminal. This confirms that your API call to ZoomInfo was successful.

Handling Errors and Common Issues with ZoomInfo API

When making API calls, it's crucial to handle potential errors gracefully. The ZoomInfo API may return various status codes indicating different issues:

  • 401 Unauthorized: Check if your access token is correct and hasn't expired.
  • 403 Forbidden: Ensure your account has the necessary permissions to access the endpoint.
  • 500 Internal Server Error: This indicates a problem on ZoomInfo's side; try again later.

Always log error messages and status codes to help diagnose issues quickly.

Conclusion and Best Practices for Using ZoomInfo API

Integrating with the ZoomInfo API can significantly enhance your business intelligence capabilities by providing access to detailed company data. However, to ensure a smooth and efficient integration, it's essential to follow best practices.

Securely Storing ZoomInfo API Credentials

Always store your API credentials securely. Avoid hardcoding them in your source code. Instead, use environment variables or a secure vault to manage sensitive information like client IDs and secrets.

Handling ZoomInfo API Rate Limits

Be mindful of the API rate limits set by ZoomInfo to prevent your application from being throttled. Implement logic to handle rate limiting gracefully, such as exponential backoff or retry mechanisms. For specific rate limit details, refer to the ZoomInfo API documentation.

Standardizing and Transforming Data from ZoomInfo API

When retrieving data from the ZoomInfo API, consider standardizing and transforming the data fields to fit your application's requirements. This ensures consistency and compatibility across different systems and datasets.

Leveraging Endgrate for Simplified Integrations

If managing multiple integrations is becoming a challenge, consider using Endgrate. With Endgrate, you can streamline your integration processes, allowing you to focus on your core product. Endgrate provides a unified API endpoint that connects to various platforms, including ZoomInfo, simplifying the integration experience for your team and customers.

Explore how Endgrate can save you time and resources by visiting Endgrate's website.

Read More

Ready to get started?

Book a demo now

Book Demo