The distribution of heat at the cold and hot sides of a thermoelectric generator (TEG) is essential to its operation. Due to the inhomogeneous pattern, the TEG power-voltage (P–V) curve exhibits multiple peaks, which pose significant consequences for TEG generation. In order to increase the system conversion efficiency at this point, tracking global peak power (GPP) using a maximum power point tracker (MPPT) is crucial. The peak generation from TEG devices cannot be harvested by traditional algorithms such as hill climbing (HC) because they fall in local peaks. Therefore, the spider wasp optimizer (SWO), a new metaheristic-based tracker, is proposed in this paper to monitor the global power from TEG system operating at inhomogeneous heat distribution. In SWO, the iterative process of changing the population length aids in avoiding local solutions. The suggested SWO-based tracker is responsible for regulating the dc-dc boost converter linked to the TEG array terminals by giving its MOSFET the proper duty cycle. Seven inhomogeneous heat distributions are examined for two TEG arrays: symmetric 9 × 9 and asymmetric 10 × 15. These heat distributions are uneven row, uneven column, diagonal, outer, center, and random. The proposed approach is compared to artificial gorilla troops optimizer (GTO), gold rush optimizer (GRO), walrus optimization algorithm (WaOA), particle swarm optimizer (PSO), chef-based optimization approach (CBOA), cuckoo search (CS), Jellyfish search approach (JS), seagull optimization approach (SOA), and sine cosine approach (SCA). With regard to 9 × 9 array, the suggested SWO-tracker performed better than the published GTO method since it increased the generated power in the following scenarios: uneven row, uneven column, SN, diagonal, outer, center, and random patterns by 1.225 W, 0.4083 W, 19.5838 W, 2.4596 W, 1.394 W, and 2.4463 W, respectively. In asymmetric array, the suggested SWO performed better than all others, obtaining the least errors in relation to the Simulink GPPs of 0.016 W, 0.0822 W, 0.3615 W, 0.0603 W, 0.0569 W, 0.0081 W, and 0.0089 W. The obtained outcomes validated the proficiency and dependability of the suggested SWO-tracker in all examined cases.