turbot/googlesearchconsole
steampipe plugin install googlesearchconsole

Google Search Console + Steampipe

Google Search Console is a free service offered by Google that helps you monitor, maintain, and troubleshoot your site's presence in Google Search results.

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

Query all the sites you are an owner of:

select
site_url,
permission_level
from
googlesearchconsole_site;
+-------------------------+------------------+
| site_url | permission_level |
+-------------------------+------------------+
| https://example.io/ | siteOwner |
| https://hub.example.io/ | siteOwner |
+-------------------------+------------------+

Documentation

Get started

Install

Download and install the latest Google Search Console plugin:

steampipe plugin install googlesearchconsole

Credentials

ItemDescription
CredentialsFollow this guide from Google. By the end of it, you should have a project on Google Cloud with the Indexing API enabled, a service account with the Owner permission on your sites.
APIs1. Go to the Google API Console.
2. Select the project that contains your credentials.
3. Click Enable APIs and Services.
4. Enable both the Google Search Console API and PageSpeed Insights API.
RadiusEach connection represents a single Google Cloud service account and can be used to query data from multiple Google Search Console properties.
ResolutionCredentials from the JSON file specified by the credentials parameter in your Steampipe config.

Configuration

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

connection "googlesearchconsole" {
plugin = "googlesearchconsole"
# You should have a project on Google Cloud with the Indexing API enabled, a service account with the `Owner` permission on your sites.
# The path to the Google Cloud credentials file of your sevice account.
# credentials = "/path/to/credentials.json"
}

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)" -- googlesearchconsole

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_googlesearchconsole;
CREATE SERVER steampipe_googlesearchconsole FOREIGN DATA WRAPPER steampipe_postgres_googlesearchconsole OPTIONS (config '<your_config>');
CREATE SCHEMA googlesearchconsole;
IMPORT FOREIGN SCHEMA googlesearchconsole FROM SERVER steampipe_googlesearchconsole INTO googlesearchconsole;

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)" -- googlesearchconsole

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_googlesearchconsole function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_googlesearchconsole.so
sqlite> select steampipe_configure_googlesearchconsole('<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)" -- googlesearchconsole

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

steampipe_export_googlesearchconsole --config '<your_config>' <table_name>