Get type of entity

Is it possible to get the type of an entity (ie "minecraft:pig") as NBT? I thought entities had an id NBT, but it turns out they don't
Continue to help post