Do you mean the REST API? I believe currently what you want requires three calls:
- one to see if the IP address exists: /api/ipam/ip-addresses/?address=1.2.3.4
- another call to find the prefix which contains the IP address: /api/ipam/ip-addresses/?contains=1.2.3.4
This will give potentially multiple prefixes, i.e. the prefix and its ancestors, so you'll need to pick the one with the longest prefix length.
- another call to see if it's within a range: /api/ipam/ip-ranges/?contains=1.2.3.4
(also specify the vrf, if that's important).
I guess a plugin could do this.