General information
Our API is created as a public resource for receiving the most complete information about the IP-address of the user. The data formats are XML or JSON with HTTP/HTTPS connection. Information in the databases updates every day and every webmaster can integrate this service with his own projects.
Our API
For the integration of our service with your projects, we offer you one of the following API:
- service "Geo-IP API";
- service "Provider-IP API".
- service "Hosting API";
- service "MAC-address API";
- service "Email API".
Restrictions in use
The inquiries' number limit to each service "Geo-IP API", "Provider-IP API", "Hosting API", "MAC-address API" or "Email API" amounts to no more than 10 inquiries from one IP address during 24 hours.
Data format
Data provided by our API contains the following fields.
Service "Geo-IP API":
Service "Provider-IP API":
Service "Hosting API":
Service"MAC-address API":
Service "Email API":
Examples of API requests
Example of XML and JSON requests to the service "Geo-IP API":
IPv4:
IPv6:
- XML: https://api.2ip.me/geo.xml?ip=2001:4860:4860::8844
- JSON: https://api.2ip.me/geo.json?ip=2001:4860:4860::8844
API call with an empty parameter "ip" returns information about the IP address from which handling comes.
Example of XML and JSON requests to the service "Provider-IP API":
IPv4:
API call with an empty parameter "ip" returns information about the IP address from which handling comes.
Example of XML and JSON requests to the service "Hosting API":
Example of XML and JSON requests to the service "MAC-address API":
- XML: https://api.2ip.ua/mac.xml?mac=00:30:48:5a:58:65
- JSON: https://api.2ip.ua/mac.json?mac=00:30:48:5a:58:65
The MAC address format for verification can be one of the following:
- 00:30:48:5a:58:65
- 00-22-15-75-1C-1E
- 000a.e475.7469
- 001201BB4ADD
Example of XML and JSON requests to the service "Email API":
Examples of response
Example of XML response from the service "Geo-IP API":
Example of JSON response from the service "Geo-IP API":
Example of XML response from the service "Provider-IP API":
Example of JSON response from the service "Provider-IP API":
Example of XML response from the service "Hosting API":
Example of JSON response from the service "Hosting API":
Example of XML response from the service "MAC-address API":
Example of JSON response from the service "MAC-address API":
Example of XML response from the service "Email API":
Example of JSON response from the service "Email API":
Python Module
We have developed a Python Module, that is easy to install and start using the API right away.
Example of use:
Install the module from PyPI:
python3 -m pip install 2ip
Retrieve provider information for the IP address 192.0.2.0 as a dict:
>>> from twoip import TwoIP >>> twoip = TwoIP(key = None) >>> twoip.provider(ip = '192.0.2.0') {'ip': '192.0.2.0', 'ip_range_end': '3221226239', 'ip_range_start': '3221225984', 'mask': '24', 'name_ripe': 'Reserved AS', 'name_rus': '', 'route': '192.0.2.0'}
Retrieve geographic information for the IP address 8.8.8.8 as a dict:
>>> from twoip import TwoIP >>> twoip = TwoIP(key = None) >>> twoip.geo(ip = '8.8.8.8') {'city': 'Mountain view', 'country': 'United states of america', 'country_code': 'US', 'country_rus': 'США', 'country_ua': 'США', 'ip': '8.8.8.8', 'latitude': '37.405992', 'longitude': '-122.078515', 'region': 'California', 'region_rus': 'Калифорния', 'region_ua': 'Каліфорнія','}
More information here: https://pypi.org/project/2ip/
Price
10 queries per day are free.
1000 requests per day to our database for 30 days cost 10$. Each following thousand is worth + 1$. For example if you want 5000 requests per day it will cost 14$ for month.
Unlimited number of queries — 100$ per month (but not more than 1 million calls per day).
After payment you will receive an email with instructions and your personal "API key". The limit will be tied to it.
You can get more detailed information by sending us a request or contact us at [email protected].