This paper provides an algorithm for identifying the multipoles of a meromorphic function from the boundary measurements, which can be applied to inverse source problems for a Poisson equation to reconstruct its source such as linear combination of mono and dipolar point sources. After establishing an algorithm that allows to identify the number, the locations and the moments of poles, we provide a stability estimate of the algorithm under the measurement error.