If you want to get the bacterial lineage, you can use NCBI taxonomy database to get complete lineage. Or this link for kegg https://www.genome.jp/kegg-bin/get_htext
If you have to get something out from the database, first you need to know what you want and select it from database. Everything is available on the database if you search carefully on the above link.