Plaid
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
- breaking v8.0.0 (August 2021) completely removed the old Client class and all previous import patterns. Any tutorial using 'from plaid import Client' or 'Client(client_id=..., secret=..., environment=...)' fails with ImportError.
- breaking plaid-python ships a major version (x.0.0) roughly monthly. Major versions may include breaking changes — new required fields, renamed parameters, or removed endpoints. Unpinned installs will auto-upgrade.
- breaking Each endpoint requires importing its specific request model. Passing a plain dict instead of the typed request object raises a TypeError. Old-style dict-based calls from pre-v8 tutorials do not work.
- gotcha Sandbox and Production have separate API secrets. The client_id is shared but the secret differs per environment. Using the wrong secret for an environment returns 401.
- gotcha Plaid API responses are typed objects, not dicts. Code trying to access response['transactions'] fails with TypeError. Attributes are accessed as response.added, response.modified, etc.
- gotcha Beta product APIs (e.g. Assets, CRA) are subject to breaking changes without versioning, with 30 days notice. GA products are versioned but the SDK fixes to a single API version — there is no per-request API version override.
Install
-
pip install plaid-python
Imports
- PlaidApi
import plaid from plaid.api import plaid_api configuration = plaid.Configuration( host=plaid.Environment.Sandbox, api_key={'clientId': CLIENT_ID, 'secret': SECRET} ) api_client = plaid.ApiClient(configuration) client = plaid_api.PlaidApi(api_client)
Quickstart
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'