DEV Community

Eric Rodríguez
Eric Rodríguez

Posted on

Day 21: Fetching Bank Transactions with Python (Plaid & Wise).

Real Data for Fintech Apps

Welcome to Day 21.
Building a Fintech app? You need data. Today I built the ingestion engine for my Financial Agent.

The Setup

Dependencies: pip install plaid-python requests

  1. The Simulation (Plaid)

Plaid Sandbox is incredible for developers. It lets you simulate a user logging into a bank (like "Platypus Bank") and returns perfect transaction data.
Snippets from my test_plaid.py:

Creating a fake public token

pt_request = SandboxPublicTokenCreateRequest(
institution_id='ins_109508',
initial_products=[Products('transactions')]
)

Exchanging it for an Access Token

exchange_response = client.item_public_token_exchange(exchange_request)

  1. The Reality (Wise)

For personal projects, Wise offers a fantastic Personal Token API.

headers = {"Authorization": f"Bearer
{WISE _API_TOKEN}" }
requests get ("https://api.wise.com/v1/profiles", headers=headers)

Lesson Learned

Always handle your SSL
ficates on macOS Python! If you get [SSL:
CERTIFICATE_VERIFY_FAILED], run the Install Certificates.command script in your Python folder.

Top comments (0)