IP addresses are issued to end users LIR (local Internet registry). LIRs are required to register various data for any assigned address space in the respective RIR (Regional Internet Registry) databases. There are 5 RIRs (ARIN, RIPE NCC, APNIC, LACNIC and AfriNIC) responsible for different parts of the world. As far as I know, they all provide a RESTful API that you can use to get the information you need.
For example, if the IP address is from Europe, you can use the RIPE API to search for inetnum objects or routes associated with any IP address:
http://rest.db.ripe.net/search?query-string=194.79.41.40
You will get several objects inside whois-resource, and the most interesting for you is the object route:
<object type="route">
<link xlink:type="locator" xlink:href="http://rest.db.ripe.net/ripe/route/194.79.40.0/22AS35796"/>
<source id="ripe"/>
<primary-key>
<attribute name="route" value="194.79.40.0/22"/>
<attribute name="origin" value="AS35796"/>
</primary-key>
<attributes>
<attribute name="route" value="194.79.40.0/22"/>
<attribute name="descr" value="NBS"/>
<attribute name="origin" value="AS35796" referenced-type="aut-num">
<link xlink:type="locator" xlink:href="http://rest.db.ripe.net/ripe/aut-num/AS35796"/>
</attribute>
<attribute name="mnt-by" value="NBS-MNT" referenced-type="mntner">
<link xlink:type="locator" xlink:href="http://rest.db.ripe.net/ripe/mntner/NBS-MNT"/>
</attribute><attribute name="source" value="RIPE" comment="Filtered"/>
</attributes>
</object>
, , , , , , .
RIR:
- (): afrinic.net
- APNIC (- ): apnic.net
- ARIN ( ): arin.net
- LACNIC ( ): lacnic.net
Edit:
, API. whois, , , JSON XML .
Whois TCP- 43 ( IP-). , . . telnet whois.ripe.net 43, 194.79.41.40 IP-, RIPE NCC.
whois , , , RIR, IP-. RIR () whois.iana.org , RIPE NCC, whois (RIR), IP. , whois, , , , .
, , 5 whois.