This document contains examples of API calls written in Python to help you get you started! Hover over a code block and click the Copy button to easily grab the code.

API Docs

Harmonic.ai | Dashboard

Table of Contents

Enrich

Enrich Company (by Domain)

Python

import requests

url = '<https://api.harmonic.ai/companies?website_domain=>'
companyDomain = 'harmonic.ai'; #Replace with the actual domain
headers = {'accept': 'application/json', 'apikey': 'yourkey'}

response = requests.post(url + companyDomain, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print('An error occurred:', response.status_code)

Enrich Person (by LinkedIn)

Python

import requests

url = '<https://api.harmonic.ai/persons?linkedin_url=>'
personLinkedIn = '<https://linkedin.com/in/>'  # Replace with the actual URL
headers = {'accept': 'application/json', 'apikey': 'yourkey'}

response = requests.post(url + personLinkedIn, headers=headers)

if response.status_code == 200:
    print(response.json())
else:
    print('An error occurred:', response.status_code)

Status

Get Enrichment Status

Python

import requests

# Example IDs and URNs
ids = [242437]  # Replace with actual integer IDs
urns = ['urn:harmonic:enrichment:242437b6-eb4d-476b-b348-3c1bcc2d7069']  # Replace with actual URNs

# Constructing the URL with query parameters
url = "<https://api.harmonic.ai/enrichment_status?">
url += 'ids=' + ','.join(map(str, ids)) + '&'
url += 'urns=' + ','.join(urns)

# Headers with API key
headers = {
    'Content-Type': 'application/json',
    'apikey': 'yourkey' # Replace with your actual API key
}

# Making the GET request
response = requests.get(url, headers=headers)

# Checking the response
if response.status_code == 200:
    print("Enrichment Status:", response.json())
else:
    print(f"An error occurred: {response.status_code}. Response: {response.text}")

Discover

Get Saved Searches

Python

import requests

url = "<https://api.harmonic.ai/savedSearches>"

# Headers with API key
headers = {
    'Content-Type': 'application/json',
    'apikey': 'yourkey' # Replace with your actual API key
}

# Making the GET request
response = requests.get(url, headers=headers)

# Checking the response
if response.status_code == 200:
    print("Saved Searches:", response.json())
else:
    print(f"An error occurred: {response.status_code}. Response: {response.text}")