the API alone doesn’t give you this data as, as you found, it doesn’t distinghish primes…
iirc a uservoice exists for this