LinkedIn + Steampipe
Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.
LinkedIn is a business and employment-focused social media platform.
Example query:
select first_name, last_name, headline, public_identifier, industryfrom linkedin_profilewhere public_identifier = 'dave';
+------------+-----------+------------------------------------+-------------------+-------------------+| first_name | last_name | headline | public_identifier | industry |+------------+-----------+------------------------------------+-------------------+-------------------+| Dave | Jones | Engineering Manager | dave | Computer Software |+------------+-----------+------------------------------------+-------------------+-------------------+
Documentation
Get started
Install
Download and install the latest LinkedIn plugin:
steampipe plugin install linkedin
Configuration
Installing the latest linkedin plugin will create a config file (~/.steampipe/config/linkedin.spc
) with a single connection named linkedin
:
connection "linkedin" { plugin = "linkedin" // Set to value of the `li_at` cookie from a logged in LinkedIn browser session token = "BQEDBQBCO8wBpUgWBBBBhhBtNDUBBBFFNDm4NU4BzcB32MRFFNDdx9md-Qk9_IFs6Lo4z8gTYb5HqUC5h-OjVDM22UiRUgjYX7CrYZw_IMIg6qUICOqqeCzjnb1tqIBIi7_HTZ3z2g_jq3JEqNjzqL7g"}
LinkedIn does not offer an official API. This plugin uses the APIs normally called by your browser when viewing the website. So, credentials are setup using a browser based session cookie. To get your authentication token for the plugin:
- Browse to LinkedIn and login.
- Open your browser developer tools.
- Open the Network view to see and analyze the network requests that make up each individual page load within a single user's session.
- Open any request to a www.linked.com URL from the list and check the Cookies tab to get the list of request cookies.
- The token is the value of the cookie named
li_at
.
Environment variables are also available as an alternate configuration method:
LINKEDIN_TOKEN
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)" -- linkedin
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_linkedin;CREATE SERVER steampipe_linkedin FOREIGN DATA WRAPPER steampipe_postgres_linkedin OPTIONS (config '<your_config>');CREATE SCHEMA linkedin;IMPORT FOREIGN SCHEMA linkedin FROM SERVER steampipe_linkedin INTO linkedin;
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)" -- linkedin
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_linkedin
function to configure it with plugin-specific options.
$ sqlite3sqlite> .load ./steampipe_sqlite_extension_linkedin.sosqlite> select steampipe_configure_linkedin('<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)" -- linkedin
You can pass the configuration to the command with the --config
argument:
steampipe_export_linkedin --config '<your_config>' <table_name>