Your IPv4 address:
Operating system:

IPv4 and IPv6 in IP APIs

An integration that has handled IPv4 addresses for years can break the first time an IP API returns an IPv6 value. The usual causes are a database field sized for dotted IPv4 and validation that expects four numbers. Fix those first, then make sure the client handles errors and rate limits according to the API contract.

Storing addresses without IPv4-length assumptions

Dotted IPv4 text is at most 15 characters, while IPv6 text can reach 39, or 45 when it ends in a dotted IPv4 part. Do not store an IP API field in a schema sized only for IPv4. Preserve canonical IPv6 text or a suitable binary representation. Accept compressed forms on input, and remember that one IPv6 address can be written in several ways, so normalise before you compare. Test loopback, mapped and dual-stack cases according to the API contract.

Telling success from each kind of failure

Validate the status code, the Content-Type, the documented fields and your quota. A client should distinguish success, validation errors, authentication failures, rate limits and temporary server errors, because each needs a different reaction. JSON versus XML does not change HTTP semantics.

Retrying without making things worse

Handle HTTP 429 separately and respect Retry-After when it is supplied. For temporary errors, use bounded exponential backoff with jitter, a small random variation in the delay. Consider idempotency before retrying. Log request identifiers, status and latency, but never API secrets. For a real request and the current API contract, see the 2ip API.