Shinobu Kawano
Published in

Shinobu Kawano

HubSpot CRM Importer

I wrote a tiny Python script for someone interested in importing CRM data into HubSpot.

HubSpot CRM Importer:

HubSpot offers a functionality of importing CRM data from CSV files. You can import contacts, companies, and deals by using it. However, it has one big limitation — you can not associate those objects when importing data. This is where HubSpot CRM Importer script shines. This script imports data from CSV files into your HubSpot portal with beautiful relationships. :)


  • Python 3+

The following articles might be helpful if you have not installed Python 3+.

If you’re using Python 2.7.9 (or greater) or Python 3.4 (or greater), then PIP comes installed with Python by default.

Getting Started

  1. Clone the repository.
$ git clone

2. Install Requests library.

$ pip install requests

3. Add your HubSpot API Key in, line 15.

API_KEY = '246b....'


You can run this script with sample import files from HubSpot Academy.

Open your terminal, and execute python command. It loads those files from csv directory and creates contacts, companies, and deals data into your HubSpot portal.

How does the script relate objects?

company_id and contact_id columns in csv files is the secret of it. The script associates objects based on values of them.

You can also set the owner of objects using hubspot_owner_email column. It finds HubSpot user by given email address and assign it to objects.

Applying the script in the real environment

I assume you will need to edit some portion of the script to meet your real environment. You may want to add properties of objects or modify column names of CSV files, etc. Feel free to adjust the script. I hope this script become a good starting point for your migration.


If the script does not work properly, please confirm import.log which will be generated in the root directory of the project. You may find information about the issue.


This software is licensed under the MIT License.

HubSpot CRM Importer:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store