ahmedsakr / wstrade-api

API Wrapper for Wealthsimple Trade

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WealthSimple get stocks routes

GabrielBottari opened this issue · comments

Wealthsimple trade app allows to get its available stocks by categories or top lists. It would be nice to have those to know which stock are available to trade.

I started investigating the API spec. Will update once I know more.

Great, keep me updated. It definitely would be a good addition to wstrade-api. I'm nearly wrapped up with v1.0.0, but it could be a minor version in v1.x.0.

I'm having a hard time reverse engineering the calls. I tried intercepting them with a vpn middleware, but the Wealthsimple Trade app seems to detect it and block it. How did you achieve this? My next attempt otherwise would be to decompile their apk.

Yep, i've already tried using motmproxy before and it's protected against MOTM attacks (good news as a customer :) ).

I have used this repo to create the API wrapper on. On top of of that, I just fiddled with the parameters and guessed the interface for some endpoints based on patterns.

I have found a few interesting endpoints:

The /securities endpoint allows much more specification:
example: https://trade-service.wealthsimple.com/securities/top_market_movers?type=gainers&limit=50&offset=150
top_market_movers can be replaced with most_watched and crypto, and gainers can be replaced with losers, most_watched and most_active (type is only available for top_market_movers)

There's also the /security-groups/{securitygroupid}/securities which allows to fetch securities by categories. To get categories just call /security-groups.
For example, we wanted to get all ETFs, we can do so with a query like: https://trade-service.wealthsimple.com/security-groups/security-group-c6153b067083/securities?limit=50&offset=50 and just change the offset to paginate over all results.

There's also more things, so let me know if you'd like me to forward it to you somehow (over slack maybe).

Would you want to add those to the library? Otherwise I could add them, but it might take a bit longer as I am not familiar with the codebase.

Alright let me know :)

Hey @GabrielBottari ,

I took a bit longer but I pushed v1 in last night. I think work on this can start. I am thinking all of this will belong in the data module perfectly. We can have a discussion about this. Feel free to hit me up on Discord (AhmedSakr#5719)

Wealthsimple trade is now available on web for everyone, so might be interesting to see whats available from the networks tab

Wow, this is amazing. This will open up the doors for using a web-socket instead of REST/HTTPS calls.