MyIP Info · Developer tools

Free IP Widget & JSON API for Developers

Add a fast public IP readout to any website, or request live connection metadata as JSON. No API key, account or client library required.

Use the embeddable widget when you want a ready-made interface. Use the JSON API when you need to build your own. Both report only the address and network of the visitor making the request.

Embed the IP widget

Paste these two lines where the widget should appear. It uses Shadow DOM, so your site's styles do not interfere with the card. The script is lightweight and does not set cookies or run advertising.

HTML
<div data-myip-info-widget></div>
<script async src="https://my-ip-info.com/widget.js"></script>
Live example

Dark theme

Add data-theme="dark" to the container. You can place multiple widgets on one page; they share a single API request per page.

HTML
<div data-myip-info-widget data-theme="dark"></div>
<script async src="https://my-ip-info.com/widget.js"></script>

JSON API

Make a simple cross-origin GET request. The response describes the client that made it, with IPv4 or IPv6, ASN and organization, approximate GeoIP, TLS and browser metadata. It never accepts an arbitrary IP for lookup.

Request
curl https://my-ip-info.com/api/ip
Example response
{
  "ip": "203.0.113.42",
  "version": "IPv4",
  "network": {
    "asn": 64500,
    "asNumber": "AS64500",
    "organization": "Example Network"
  },
  "location": {
    "country": "US",
    "city": "New York",
    "timezone": "America/New_York"
  },
  "connection": {
    "protocol": "HTTP/2",
    "tlsVersion": "TLSv1.3"
  }
}

Arbitrary IP lookup

For GeoIP, ASN, RDAP/WHOIS registration and reverse DNS of a supplied IPv4 or IPv6 address, use the lookup endpoint. It queries independent public data sources and returns partial results when optional registration or PTR data is unavailable.

Request
curl "https://my-ip-info.com/api/lookup?ip=8.8.8.8"

Try the interactive IP Lookup

Integration and fair use

  • CORS: enabled for browser integrations with Access-Control-Allow-Origin: *.
  • Privacy: responses are no-store. Do not publicly cache a visitor's report or log it without a valid purpose.
  • Client IP: a server-side request returns your server's network, not your end user's network. Call the API from the visitor's browser when that is what you need.
  • Reliability: handle timeouts and unavailable fields. No field is guaranteed for every connection, and this free endpoint has no uptime SLA.
  • Fair use: avoid high-volume polling and use sensible client-side caching only for the current page view.

Attribution and referral measurement

The widget includes a small MyIP Info link with UTM parameters so referral visits can be measured when you connect privacy-friendly analytics. The link is nofollow for search-policy safety; it is intended for attribution and discovery, not artificial ranking manipulation.

When the widget runs on another website, the visitor's browser contacts this API directly. Your page does not need to collect or forward any account information.