In this section, we present how to connect Plaid to MindsDB.

Plaid is a financial technology company that offers a platform and a set of APIs that facilitate the integration of financial services and data into applications and websites. Its services primarily focus on enabling developers to connect with and access financial accounts and data from various financial institutions.

Data from Plaid can be utilized within MindsDB to train AI models and make financial forecasts.

Prerequisites

Before proceeding, ensure the following prerequisites are met:

  1. Install MindsDB locally via Docker or Docker Desktop.
  2. To connect Plaid to MindsDB, install the required dependencies following this instruction.
  3. Install or ensure access to Plaid.

Connection

The required arguments to establish a connection are as follows:

  • client_id
  • secret
  • access_token
  • plaid_env

You can get the client_id, secret, and access_token values here once you sign in to your Plaid account. And here is how you generate the access_token value.

In order to make use of this handler and connect the Plaid app to MindsDB, the following syntax can be used:

CREATE DATABASE my_plaid 
WITH 
    ENGINE = 'plaid',
    PARAMETERS = {
      "client_id": "YOUR_CLIENT_ID",
      "secret": "YOUR_SECRET",
      "access_token": "YOUR_PUBLIC_KEY",
      "plaid_env": "ENV"
    };

It creates a database that comes with two tables: transactions and balance.

Usage

Now you can query your data, like this:

SELECT id, merchant_name, authorized_date, amount, payment_channel
FROM my_plaid.transactions 
WHERE start_date = '2022-01-01' 
AND end_date = '2023-04-11' 
LIMIT 20;

And if you want to use functions provided by the Plaid API, you can use the native queries syntax, like this:

SELECT * FROM my_plaid (
  get_transactions(
    start_date = '2022-01-01',
    end_date = '2022-02-01'
  )
);

For more information about available actions and development plans, visit this page.