As I said before, once you get the JSON from the Horizon API, you then only need to filter by those accounts with more than 0 in their balance. If you don't want to do it manually you need to code an script that consumes the response from the API, filter them and at the end it only gives you the public key of each account (maybe in a .txt file)