Skip to content
A Go package to interact with the HubSpot API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



Why build this?

HubSpot has a great API to allow you to create a functional application or integration quickly and easily. The APIs they expose are the same that power the HubSpot application. There isn't a good abstraction to be able to use those in Go apps, unless you want to marshal and unmarshal things yourself and have code with tons of HTTP requests.


To use the HubSpot module, you'll need to create an API key. That key can be used to create the hubspot client.

import (


func main() {
    hubspot := client.NewClient().WithAPIKey("<myAccessToken>")

Depending on which type of resource you want to access, you'll need to import one of the services

import (
    "" // If you want to use the contacts API
    "" // If you want to use the crm associations API
    "" // If you want to use the deals API
    "" // If you want to use the engagements API
    "" // If you want to use the tickets API

For example, getting the first name of the most recently updated contact in HubSpot would be like:

package main

import (


func main() {
    // Create a new HubSpot client
    hubspot := client.NewClient().WithAPIKey("<myAccessToken>")
    // Create a new Contacts service
    contactsSvc := contacts.New(hubspot).WithProperties([]string{"firstname"})
	// Get all the recentlu updated contacts
    contacts, _err_ := contactsSvc.GetRecentlyUpdatedContacts()
    // Print the first in the array
    fmt.Printf("%s", contacts[0].Properties["firstname"]["value"])


Currently the methods I use regularly are implemented, so chances are that something you might need is missing. If something is missing, or if you'd like to suggest new features feel free to create an issue or a PR!


See the LICENSE file in the repository


A most sincere thanks to the team of HubSpot, for building a great CRM!

_This package is not endorsed by HubSpot

You can’t perform that action at this time.