With the recent advancement in the field of power electronics devices and an increasing number of nonlinear loads in the power system, the maintenance of good power quality at the consumers’ end is one of the major concerns of today’s power distribution systems. The introduction of a large number of power electronics devices in the system introduces power quality issues like voltage flicker, voltage distortions, harmonic distortions, voltage sag-swell, etc. Due to this, the maintenance of good power quality at the consumer end becomes a major challenge for distribution companies. The Custom power devices (CPD) have been used in the power system to address these issues and improve power quality. However, optimal placement and sizing of CPD is a challenge itself. In this paper, the optimal location and rating of CPD (STATCOM and APLC) have been determined using the APSO and JAYA optimization techniques, both of these techniques are known for their robustness. The main objective of the paper is to minimize the total harmonic distortion, total CPD size, harmonic transmission line loss, telephone influence factor, and motor load loss. Further, the performances of allocated CPD in controlling the voltage quality and reactive power are evaluated. The performance from the APSO and JAYA algorithm on an IEEE-16 bus and 69 bus distribution system has been compared to each other.