Export Starling statements to Banktivity and PocketSmith

John Bradshaw
Sep 3, 2018 · 1 min read

Moved to -> https://bradshaw.cloud/2018/09/03/export-starling-statements-to-banktivity-and-pocketsmith/

I use Starling Bank but I found that exporting the data on a regular basis to Banktivity or PocketSmith was fairly tricky, as typing in a complex password on a phone to export a CSV, to copy it to shared storage, to copy it from shared storage to my Mac, to import it into the app; to be a fairly tedious process.

You will need to create a developer account, here, and generate your Authorisation token (for which I use Paw to take the grunt work out of testing API calls)

#!/bin/bash
#Convert Starling JSON output to a usable CSV
## Request
curl 'https://api.starlingbank.com/api/v1/transactions/' \
-H 'Cookie: __cfduid=<<YOUR_COOKIE_HERE>>' \
-H 'Authorization: Bearer <<YOUR_BEARER_TOKEN_HERE>>' > starling.json
json2csv -i starling.json -f _embedded.transactions.created,_embedded.transactions.narrative,_embedded.transactions.source,_embedded.transactions.amount -u _embedded.transactions -B -o starling.csv

This uses the json2csv NPM package, available here, and using the following options to configure the right output.

Options:-i, --input <input>                  Path and name of the incoming json file. If not provided, will read from stdin.-o, --output [output]                Path and name of the resulting csv file. Defaults to stdout.-f, --fields <fields>                Specify the fields to convert.-u, --unwind <paths>                 Creates multiple rows from a single JSON document similar to MongoDB unwind.-B, --unwind-blank                   When unwinding, blank out instead of repeating data.

John Bradshaw

I work for Skytap. I mainly use this site to remind me of how to do things that I have forgotten.

John Bradshaw

Written by

Principal Architect @Skytap, views and opinions are my own etcetera etcetera…

John Bradshaw

I work for Skytap. I mainly use this site to remind me of how to do things that I have forgotten.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade