1. You need to start by syncing with the bitcoin blockchain (such as by running bitcoin core). You can then use software to parse the blockchain database (there's quite a lot of options available, as well as running the commands on the daemon yourself)..
Parsing blockchain database (basically read
.blk file) could be hard task, especially when you have no idea about it's structure/indexing. IMO running blockexplorer or Electrum server and obtain the data from their API is more practical option.