Sadly, that seems to not be possible. The modding API only includes one function related to pins, which is "add_pin" (which does exactly what it sounds like).
I assume the reasoning behind that is that internally pins are very client-side and all mods (even client UI mods like this one) are technically shared to a degree, so mods can only access things that are synchronized with the main game state.