BGGET returns a 16-bit value, where each bit determines information about the BG tile. The first 12 bits will determine the ID of the BG tile, which is probably what you want. You can find information about other bits in the help entry. To get the values of the bits, you can do an AND operation with the return value and a value whose on-bits match the ones you want to get.