Plaid

38.3.0 · active · verified Sun Mar 01

Official Python client for the Plaid API (bank account linking, transactions, identity, income verification). Auto-generated from OpenAPI spec. Updated monthly, major versions contain breaking changes. Only supports the 2020-09-14 API version (no version selection in client — API version is fixed per SDK release).

Warnings

Install

Imports

Quickstart

Plaid uses strongly-typed request/response models. Each endpoint has its own request model (e.g. TransactionsSyncRequest). Import the specific model for each call.

import plaid
from plaid.api import plaid_api
from plaid.model.transactions_sync_request import TransactionsSyncRequest
import json

configuration = plaid.Configuration(
    host=plaid.Environment.Sandbox,  # or Production
    api_key={
        'clientId': 'your_client_id',
        'secret': 'your_secret'
    }
)
api_client = plaid.ApiClient(configuration)
client = plaid_api.PlaidApi(api_client)

# Sync transactions
request = TransactionsSyncRequest(access_token='access-sandbox-...')
response = client.transactions_sync(request)
transactions = response.added

# Error handling
try:
    response = client.transactions_sync(request)
except plaid.ApiException as e:
    error = json.loads(e.body)
    print(error['error_code'])  # e.g. 'ITEM_LOGIN_REQUIRED'

view raw JSON →