Your IPv4 address:
Operating system:

API rate limits and retries

Your script worked all morning and then started receiving HTTP 429. The API is saying that you sent too many requests in the allowed time. Rate limits and retry rules are part of the contract between a client and an API, and a well-behaved client tells apart success, validation errors, authentication failures, rate limits and temporary server errors.

What to do when the API answers 429

Handle 429 as its own case. If the response carries a Retry-After header, wait at least as long as it says and do not sleep for a fixed interval of your own. If it does not, use exponential backoff: lengthen the pause after each failed attempt. Add jitter, a small random variation, so that many clients do not all retry at the same moment. Put a ceiling on the number of retries.

Which failures are worth retrying

A validation error or an authentication failure will fail the same way every time, so correct the request or the credentials. A temporary server error may succeed later. Before any automatic retry, consider idempotency: whether repeating the request is harmless. Do not replay an operation that could create a duplicate side effect.

What to validate and what to log

Check the Content-Type, the status code, the documented fields and your remaining quota. JSON or XML makes no difference to HTTP semantics. If responses contain IP addresses, store them without assuming the length of an IPv4 address, because IPv6 addresses are longer. Log request identifiers, status and latency, and never API secrets. For a real request and the current contract, see the 2ip API.