SDKs & Libraries
Use StatementParse from your language of choice. The API is a simple REST endpoint that works with any HTTP client.
i
No SDK required
StatementParse is a single-endpoint REST API. You can use it directly with
curl, fetch, requests, or any HTTP client. Official SDKs are planned for the future.Python
python
import requests
API_KEY = "sp_live_your_key_here"
BASE_URL = "https://api.statementparse.dev"
def parse_statement(file_path: str, format: str = "json") -> dict | str:
"""Parse a bank statement PDF and return structured data."""
with open(file_path, "rb") as f:
response = requests.post(
f"{BASE_URL}/v1/parse",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"file": f},
params={"format": format},
)
response.raise_for_status()
if format == "csv":
return response.text
return response.json()
# JSON output
result = parse_statement("chase-january-2025.pdf")
for txn in result["transactions"]:
cat = txn["category"] or "—"
conf = txn["field_confidence"]["amount"]
print(f"{txn['date']} {cat:15s} {txn['amount']:>10.2f} (confidence: {conf})")
# CSV output
csv_data = parse_statement("chase-january-2025.pdf", format="csv")
with open("transactions.csv", "w") as f:
f.write(csv_data)JavaScript / TypeScript
typescript
const API_KEY = "sp_live_your_key_here";
const BASE_URL = "https://api.statementparse.dev";
async function parseStatement(file: File, format = "json") {
const form = new FormData();
form.append("file", file);
const response = await fetch(
`${BASE_URL}/v1/parse?format=${format}`,
{
method: "POST",
headers: { Authorization: `Bearer ${API_KEY}` },
body: form,
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.message);
}
return format === "csv" ? response.text() : response.json();
}
// JSON with categories and confidence
const data = await parseStatement(file);
for (const txn of data.transactions) {
console.log(txn.date, txn.category, txn.amount, txn.field_confidence);
}
// CSV download
const csv = await parseStatement(file, "csv");cURL
bash
# Parse a statement (JSON)
curl -X POST https://api.statementparse.dev/v1/parse \
-H "Authorization: Bearer sp_live_your_key_here" \
-F "file=@statement.pdf"
# Parse a statement (CSV)
curl -X POST "https://api.statementparse.dev/v1/parse?format=csv" \
-H "Authorization: Bearer sp_live_your_key_here" \
-F "file=@statement.pdf" -o transactions.csv
# Check usage
curl https://api.statementparse.dev/v1/usage \
-H "Authorization: Bearer sp_live_your_key_here"
# List supported banks
curl https://api.statementparse.dev/v1/banksComing Soon
Python SDKPlanned
pip install statementparse
Node.js SDKPlanned
npm install statementparse
Go SDKPlanned
go get statementparse