New Feature: XML Support Added

We’re excited to announce that freeipapi.com now supports XML responses, in addition to JSON! 🎉

This update makes it even easier for developers and businesses who prefer working with XML to integrate IP geolocation and network information into their applications.

Why XML Support?

While JSON has become the most common format for modern APIs, XML is still widely used in many enterprise systems, legacy integrations, and tools where structured data in markup is preferred. By adding XML support, we’re giving you more flexibility—so you can use the format that best suits your workflow.

Getting Started

Using XML with FreeIPAPI is just as easy as using our JSON endpoints.

JSON (existing)

GET /api/json/{ip}

XML (new)

GET /api/xml/{ip}

That’s it—just swap json with xml in the API path depending on the format you’d like!

Parameters

Parameter Description Type Required Default
ip The IP address you want to get the info of string No The requester’s IP address

If you don’t provide an ip, the API automatically returns details for the requester’s IP.


Example Responses

JSON Example

{
  "ipVersion": 4,
  "ipAddress": "1.1.1.1",
  "latitude": -33.8688,
  "longitude": 151.209,
  "countryName": "Australia",
  "countryCode": "AU",
  "capital": "Canberra",
  "phoneCodes": [61],
  "timeZones": [
    "Antarctica/Macquarie",
    "Australia/Adelaide",
    "... more ..."
  ],
  "zipCode": "4000",
  "cityName": "Sydney",
  "regionName": "New South Wales",
  "continent": "Oceania",
  "continentCode": "OC",
  "currencies": ["AUD"],
  "languages": ["en"],
  "asn": "13335",
  "asnOrganization": "Cloudflare, Inc.",
  "isProxy": false
}

XML Example

<response>
  <ipVersion>4</ipVersion>
  <ipAddress>1.1.1.1</ipAddress>
  <latitude>-33.8688</latitude>
  <longitude>151.209</longitude>
  <countryName>Australia</countryName>
  <countryCode>AU</countryCode>
  <capital>Canberra</capital>
  <phoneCodes>61</phoneCodes>
  <timeZones>Australia/Sydney</timeZones>
  <zipCode>4000</zipCode>
  <cityName>Sydney</cityName>
  <regionName>New South Wales</regionName>
  <continent>Oceania</continent>
  <continentCode>OC</continentCode>
  <currencies>AUD</currencies>
  <languages>en</languages>
  <asn>13335</asn>
  <asnOrganization>Cloudflare, Inc.</asnOrganization>
  <isProxy>false</isProxy>
</response>

When to Use JSON vs. XML?

  • Use JSON if you’re building modern web apps, APIs, or mobile applications. (Lightweight & popular)
  • Use XML if you’re working with enterprise software, legacy systems, or integrations requiring XML.

Now with FreeIPAPI, you don’t have to choose—we’ve got both covered.

Try It Out

Head over to our API Reference to explore the endpoints and start using XML responses today.

We’d love to hear your feedback—do you prefer working with JSON, XML, or both? Let us know what you’d like to see next!