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

Stripe is a financial technology company that provides a set of software and payment processing solutions for businesses and individuals to accept payments over the internet. Stripe is one of the leading payment gateway and online payment processing platforms.

Data from Stripe can be utilized within MindsDB to train AI models and chatbots based on customers, products, and payment intents, and make relevant predictions and forecasts.


This handler was implemented using stripe-python, the Python library for the Stripe API.

There is only one parameter required to set up the connection with Stripe:

  • api_key: a Stripe API key.

You can find your API keys in the Stripe Dashboard. Read more.

To connect to Stripe using MindsDB, the following CREATE DATABASE statement can be used:

CREATE DATABASE stripe_datasource
WITH ENGINE = 'stripe',
  "api_key": "sk_..."

If you installed MindsDB locally via pip, you need to install all handler dependencies manually. To do so, go to the handler’s folder (mindsdb/integrations/handlers/stripe_handler) and run this command: pip install -r requirements.txt.


Now, you can query the data in your Stripe account (customers, for example) as follows:

SELECT * FROM stripe_datasource.customers

You can run more advanced queries to fetch specific customers in a defined order:

SELECT  name, email
FROM stripe_datasource.customers
WHERE currency = 'inr'

Supported tables

The following tables are supported by the Stripe handler:

  • customers
  • products
  • payment_intents