KEGG organisms are assigned 3 letter codes, e.g., “hsa” for homo sapiens. To map these codes to the NCBI taxonomy ID, a one-liner sed command is sufficient:

First download by copy n’ paste from the KEGG taxonomy page:

Save it to a text file kegg_taxonomy.txt

Then sed:

sed -n 's/.*\[TAX\:\([0-9]*\)\] \[GN\:\([a-z]\{3\}\)\].*/\2 \1/p' kegg_taxonomy.txt > kegg2taxonomy.txt

Download kegg2taxonomy.txt