Use a ruler to measure the diameter of the hole in mm. Order a pack on amazon and hope it's the right thing. If it's not, order a little bigger/smaller.
Measured...ended up getting on Amazon, and it worked. Surprisingly, most of the shelf pegs ending up being different types.
I had already tried bringing the pegs to HD, they said they didn't have matching ones.
I prefer to avoid solutions requiring drilling, because a) my handyman skills are limited, and b) even if they weren't, when dealing with a relatively expensive bookshelf I'd rather not start modifying anything.