femueller / python-n26

💵 Unofficial Python client for n26 (Number 26) - https://n26.com/
MIT License
195 stars 34 forks source link

Support transactions within spaces #128

Open stevenleeg opened 1 year ago

stevenleeg commented 1 year ago

I'm relatively new to the N26 API so forgive me if I'm lacking context here, but is there any way to query transactions that occur within spaces? According to the PSD2 documentation the main transactions endpoint only returns transactions from the main space. Unfortunately I don't see any other information about accessing data within spaces, and it appears the current n26 spaces command is broken which leads me to believe they've shuffled their API around.

The data shows up in the app, so clearly there is some way of accessing it, but I'm guessing it will require some sleuthing rather than a clearly defined API endpoint. Is there a standard procedure for figuring out how these undocumented APIs work?

stevenleeg commented 1 year ago

Update: I've been doing a bit of digging myself and am finding some less than encouraging results. At the suggestion of N26's responsible disclosure page, I started looking around at the API requests being made by their web app. Unfortunately it looks like everything there is using a different GraphQL API at app.n26.com, including a getSpaceTransactions query which has the data I'm looking for here.

Unfortunately it sounds like getting that GraphQL API working is quite the challenge as the folks over at the golang implementation have discovered. It looks like there's some wonky public/private key stuff going on for each request that may prove challenging to reverse engineer (details here). It does seem possible though, just not straightforward.

If anyone has any other details/hints about how we might go about doing something like this feel free to add to this thread. It seems like eventually switching to the GraphQL is the way to go unless I'm missing something.

tranb3r commented 1 year ago

Why don't you use the mobile app API ? I've detailed the queries here: https://github.com/femueller/python-n26/issues/110#issuecomment-1414022349