How to extract Curve data and make your own API


I’ve wanted to show you how I managed to write a script automatically extracting my own transaction data out of Curve for my own purposes and how you can do it too (if you know some basic Python). The premise behind is that you can conduct an analysis of your own spend habits the way you want to, or even trigger some actions every time you make a purchase. I don’t really have any specific reason for doing that, at least for now, but while programming I always wanted to work on real data and I am looking forward to finding new ways in which it could be used.

A little disclaimer here: first of all, I know that I can extract CSV files from the Curve app itself. What I’m trying to achieve is more of an automated, flexible solution that doesn’t need any further action on user’s side. On another note, I know that what I did is pretty much a bodge that can stop working any time. I made it mostly for fun and it shouldn’t be used in any professional projects.

Step 1: Getting your transaction data out of Curve sandbox
Well, Curve doesn’t offer any type of a public API that would let you ask for your data. Does it mean that there’s no way of getting it? Obviously not. Curve offers this awesome feature called Receipts, which sends you an e-mail every time a transaction is made or updated. So, the best thing would be activating that feature for all your underlying cards. That’s our first hook that will let us access our information. I haven’t found any way to easily get historical data in an automated way. If you have any ideas, let me know!

Step 2: Keeping your inbox tidy and sorting your incoming Receipts
An e-mail every time you buy anything? That’s a lot of e-mails. So, in order to keep your inbox clean you need to set up a filter that will redirect the receipts into a dedicated folder. This will also come in handy later. I use Gmail, so my filter looks like this:

This means, that every receipt e-mail I get will skip inbox and will be automatically moved to a seperate place. This way it doesn’t affect our mail account and makes our script run faster.

Step 3: Downloading e-mails using a Python script
This is where the fun begins. You basically need to write a script that will download all the messages sent by Curve. I used Python 3 and a imap_tools module. (Note: if you use Gmail, this won’t work unless you give an explicit permission for your account to be accessed via less secure apps in settings). Notice how reaching the right mails is simpler when you have a filter set up.

Step 4: Parsing those e-mails
How much you get out of these mails is really a matter of your determination. As for now, my script uses only the data provided in the subtitles. That is:

  • a merchant name,
  • date of the purchase,
  • amount and a currency.

In the future I will try to edit my script to include other data in the e-mails, such as

  • amount in original currency (for foreign transactions),
  • time of the purchase,
  • date and time of the updates (Go Back in Time and/or refunds),
  • the underlying card details.

There are also some details that are unavailable to get that way (at least in the current form), for instance:

  • MCC codes/categories
  • how much you saved on fees.

Step 5: Using your data
Now that you extracted all the data from the e-mails sent by Curve, you can process it however you want. For instance, you can find the stores that get too much of your money or those that you visit really often. You can categorise them the way you want and make more thoughtful decisions, as your own code can give you more detailed overview than Curve Insights. I also considered tweaking this idea, so purchases could act like triggers for other actions (IFTTT-like), but with recent Push notification delays that would be kinda pointless.

Here’s a snippet of how it worked out for me:

Again, I know that for most this is an extremely mundane and nerdy topic, so thank you for those who read it all. Please leave your feedback on this if you think you could contribute, you enjoyed it, or if you want to get the source code. I am especially interested in an opinion of someone from Curve team, as I’m not entirely sure if such things are encouraged by you (and I truly hope I didn’t break any Terms and Conditions :grin:).


Hey @Pawel, this is very impressive!

Could you drop me a dm so I can discuss this further with you? :slight_smile:

1 Like

This is fantastic :clap: :heart_eyes: Just shared it with the whole Curve Team - let’s see what they say!


Hi Pawel !

This is an amazing way of automating and collating all of your transactions from Curve and don’t worry, you didn’t break any T & Cs as you are using your own data :wink: !

Your suggestions on categorising your spend based on your own spending behaviour and creating triggers is a good way to gain insights into your finances and do more with your money.

To add on to your suggestions, you can also use the data to extrapolate and forecast your monthly spend to see whether you’re within your monthly budget and how many days until you reach your monthly budget. This can be completed easily with some free tools such as Google Sheets.

A really awesome use of our receipt feature and definitely not a nerdy topic!



Hello Alan!

Thank you for your answer! It means a lot, especially that (as I can see) that’s your first post on this community as a whole. I got mostly inspired by the open banking/PSD2 trend coming up, except I didn’t want to wait and I can’t get any licenses anyway, so I decided to bodge something on my own.

I personally don’t need that much of budgeting, as my finances are pretty simple, but I guess that might be more useful for other people. I’ve been working on turning this into more accessible solution (that wouldn’t require that much of technical knowledge), but had a lot of other stuff to do, so I didn’t make any real progress. Later on I hope to have much less stuff troubling my head so I’m planning to make a ready-to-go solution and publish it on Github or somewhere else.

I am currently working on a script that could parse transaction details from the Curve emails that I have been getting for almost a year now.

I have noticed that the email template has changed somewhere around May of this year. So my script will have to take care of that as well.

I’ll let you know how it goes. Did you end up creating something functional?

P.S. I have started to work on this because will introduce CSV transaction imports soon. :slight_smile:

I have created and successfully used the following tool to extract transaction descriptions, amounts and dates from curve emails:

Currently it groups transactions by month, so I plan to run this at the beginning of every month to parse previous month transactions and import those to Lunch Money.

Something more automated would be preferable. But that is for later.

Would love to hear your feedback if you end up using it.