Importing watch only is a manual process. I am looking for a programmable solution. In which we can send requests to electrum servers. Like simple http or json requests
You'll have to forgive me, I'm trying to guess what you're trying to do, you haven't given us many details. It sounds like you want to take the addresses from your website sales, and automatically check their balances. You can do that with the Electrum client. You can copy the entire list of public addresses and paste them into a new or existing watch-only wallet. It's manual, but doesn't take very much time. You don't have to do one address at a time.
I imagine you (or someone) can write a script that exports your web sales, extracts the addresses, and creates a new wallet with those addresses. It's beyond my skills, but I reckon it's possible. As for something that already exists that will do what you want, I don't know about anything.
API usually have limits to check balances like you can request X amount of addresses in X seconds. some also require KYC. If we can query our own server or multiple public servers then it is decentralized way.
They place those limits to prevent spam, after all their computer (server) can only handle so many requests before it hangs. It is going to be the same with an Electrum node, they are not designed to handle too many requests either and I believe they may end up banning your IP.
Generally speaking Electrum is not designed for scaling, it is designed for convenience and ease of use for regular users with small number of addresses to check. Depending on the size of your requests it is best if you run your own indexed node.
Can Electrum servers be used to confirm payments for website invoices?
It's possible if you can mimic Electrum's connection with the servers (
it's open-source):
github.com/spesmilo/electrum/blob/master/electrum/network.pyFor example, there are other clients/wallets that can use Electrum's server like "
Blue" and "
Sparrow" to mention a few.
But as mentioned above, most Electrum server implementations have even smaller limits than blockexplorer APIs, which is set by default.
Thank you all for such generous response. I understand it now. I thought maybe these servers are limit less and work like nodes where we can query data. Was thinking to make a custom payment processor but it seems not possible with this approach.
Thank you