Since API calls can be locked with IP access restrictions, it would be helpful if there was an API call that returned the caller’s IP address as seen by Binance.
Hi, this seems to be a concern that would be much easier to be managed locally than having the need to recur to the API call, as the IP address is defined by the client.
The IP address that the client uses to access Binance is not necessarily the IP address that the access comes from.
For example, if the client is behind NAT, the client’s IP address is NOT the address that Binance sees.
Hosting providers, such as AWS, often use internal vs external IP addresses.
Being able to ask Binance the IP address used for access means that the person running said client has the right information for setting the IP restriction.
Try to do one harmless thing on fapi (for e.g. get your futures account balance), if it’s rejected, youcan get the request ip in the reject msg
Do you get the IP if it is blocked for your account?
You’d get something like this:
{
“code”: -2015,
“msg”: “Invalid API-key, IP, or permissions for action, request ip: xxxx”
}
Try it yourself
I registered on this cheap stack overflow alternative especially to write this comment. With that pseudo-safe restriction you simply made impossible to communicate with the Binance API from Russia, North Korea, China and other countries with nazi regimes because most of VPN services are using dynamic IP addresses for each request (for example, ExpressVPN).
Crypto currencies for many people is the only route from that shit holes. Especially after SWIFT gas chamber situation. I simple wrote an adapter to use kucoin instead of binance due to that, because living without vpn is a high risk which I definitely not going to take.