Code Examples

Copy-paste code examples for every language

Grab Your IP in Any Language

Every example on this page calls the same API. Same base URL. Same JSON response. Same “just works” energy. The only thing that changes is the language you write it in.

The base URL is https://whatismyip.technology/api/me. Every endpoint returns JSON. No API key needed. No signup. No OAuth token you have to refresh every 47 minutes. Just HTTPS and GET requests (except bulk, which is a POST).

All seven endpoints are covered in every language example:

EndpointWhat it does
GET /apiReturns your own IP address
GET /api/{ip}Full lookup for any IP
GET /api/{ip}/geoGeolocation only
GET /api/{ip}/asnASN and network info
GET /api/{ip}/privacyVPN, proxy, Tor detection
GET /api/{ip}/companyCompany and abuse contact info
POST /api/bulkLook up multiple IPs at once

Pick your language and start copying.

Available Languages

  • curl — The command line classic. Great for quick tests and shell scripts.
  • Python — With requests and aiohttp. Sync and async.
  • JavaScript — Browser fetch and Node.js. TypeScript types included.
  • Go — Struct definitions, JSON unmarshaling, the whole deal.
  • PHP — file_get_contents and cURL. Old school and new school.
  • Ruby — Net::HTTP with clean, readable code.

Every example works out of the box. Copy it, run it, get IP data back. If it doesn’t work, something is very wrong with the internet and you probably have bigger problems.

In This Section