how to check for iPhone battery replacement eligibility under warranty?
Call Apple or request an evaluation from their support web site. They are the final judge of warranty status and can run a check on your device remotely - generally while you wait.

The API to get that data is private and generally doesn't work on iOS - Is there an iPhone app (as opposed to desktop software) that shows actual battery cycles - cycles number

You can use computers to get FCC and cycle counts - How to figure out iOS device battery health?

Whether you can get the 80% value like apple isn't guaranteed with that data since I believe they read far more internal counters and often offer a replacement even when you aren't at 80% in many cases.