python-n26
python-n26 copied to clipboard
Support transactions within spaces
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?
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.
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