Skip to main content

Python API Examples

Copy-paste Python code to integrate with Harmonic's API

Harmonic Team avatar
Written by Harmonic Team
Updated over 2 weeks ago

Need to get started with Harmonic's API using Python? We've created a collection of ready-to-use code snippets to help you integrate quickly.

Each code example includes:

  • Complete working code you can copy and paste

  • Comments explaining what to replace with your own values

  • Error handling examples

  • Proper authentication headers

Quick start

All examples follow the same pattern:

  1. Import the requests library

  2. Set up your API endpoint URL

  3. Add your API key to the headers

  4. Make the request and handle the response

import requests

url = 'https://api.harmonic.ai/companies?website_domain=harmonic.ai'
headers = {'accept': 'application/json', 'apikey': 'your_api_key'}

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

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

Need more help?

Questions? Contact support at support@harmonic.ai.

Did this answer your question?