steampipe plugin install hubspot

HubSpot + Steampipe

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

HubSpot is a CRM platform with all the software, integrations, and resources you need to connect marketing, sales, content management, and customer service. Each product in the platform is powerful on its own, but the real magic happens when you use them together.

List your HubSpot deals:

select
id,
created_at,
archived,
amount,
dealname,
pipeline,
dealstage
from
hubspot_deal;
+-------------+---------------------------+----------+--------+----------+----------+----------------------+
| id | created_at | archived | amount | dealname | pipeline | dealstage |
+-------------+---------------------------+----------+--------+----------+----------+----------------------+
| 13432979812 | 2023-05-24T17:09:39+05:30 | false | 10000 | test | default | appointmentscheduled |
+-------------+---------------------------+----------+--------+----------+----------+----------------------+

Documentation

Quick start

Install

Download and install the latest HubSpot plugin:

steampipe plugin install hubspot

Credentials

ItemDescription
CredentialsHubSpot requires a Private App Token for all requests.
PermissionsThe permission scope of Private App Tokens is set by the Admin at the creation time of the tokens.
RadiusEach connection represents a single HubSpot Installation.
Resolution1. Credentials explicitly set in a Steampipe config file (~/.steampipe/config/hubspot.spc)
2. Credentials specified in environment variables, e.g., HUBSPOT_PRIVATE_APP_TOKEN.

Configuration

Installing the latest hubspot plugin will create a config file (~/.steampipe/config/hubspot.spc) with a single connection named hubspot:

Configure your account details in ~/.steampipe/config/hubspot.spc:

connection "hubspot" {
plugin = "hubspot"
# The HubSpot Private APP Token. Required.
# Get your Private APP token from HubSpot https://developers.hubspot.com/docs/api/private-apps.
# Can also be set with the `HUBSPOT_PRIVATE_APP_TOKEN` environment variable.
# private_app_token = "pat-na1-70271006-11d8-4a5d-9169-b12f4327e5b"
}

Alternatively, you can also use the standard HubSpot environment variable to obtain credentials only if private_app_token is not specified in the connection:

export HUBSPOT_PRIVATE_APP_TOKEN=pat-na1-70271006-11d8-4a5d-9169-b12f4327e5b

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- hubspot

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_hubspot;
CREATE SERVER steampipe_hubspot FOREIGN DATA WRAPPER steampipe_postgres_hubspot OPTIONS (config '<your_config>');
CREATE SCHEMA hubspot;
IMPORT FOREIGN SCHEMA hubspot FROM SERVER steampipe_hubspot INTO hubspot;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- hubspot

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_hubspot function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_hubspot.so
sqlite> select steampipe_configure_hubspot('<your_config>');

Export

This plugin is available as a standalone Export CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- hubspot

You can pass the configuration to the command with the --config argument:

steampipe_export_hubspot --config '<your_config>' <table_name>