How to connect to a public node through json RPC?
Not all nodes will have the JSON-RPC enabled, and especially without private credentials. You will probably find a block explorer API much more accessible, because they are built to handle public traffic. There are many blockchain explorers online that have public apis, they are easy to find.