A status code tells you how an HTTP exchange ended. The JSON body tells you what your application can do with the response. A search or lookup client usually needs both answers. If it treats every HTTP 200 as a match, it can mark an empty result as success and hand a missing value to downstream code.
GimmeProxy’s response documentation gives a concrete example. A filtered lookup with no matching endpoint returns HTTP 200 with an error object. The service uses HTTP 429 for a quota or rate limit. Your UI can show an empty state for the former and preserve any Retry-After header for the latter.
Encode those states before wiring up the UI
This Python function runs offline. Its inputs are a status code and a JSON value that a caller has already decoded. Unexpected response shapes get a dedicated outcome.
def classify(status: int, body: object) -> str: if status == 429: return "rate_limited" if status != 200: return "http_error" if not isinstance(body, dict): return "unexpected_response" if body.get("error") == "no more proxies left": return "no_match" if isinstance(body.get("ipPort"), str) and body["ipPort"]: return "match" return "unexpected_response" assert classify(200, {"ipPort": "192.0.2.1:8080"}) == "match" assert classify(200, {"error": "no more proxies left"}) == "no_match" assert classify(429, None) == "rate_limited" assert classify(200, {"ipPort": None}) == "unexpected_response" assert classify(503, None) == "http_error" The fixture IP is reserved for documentation. In a real caller, handle transport timeouts and JSON decoding errors separately before passing a decoded body to this function. Preserve the status code and any Retry-After header when reporting a limit. A quota limit and a temporary rate limit can warrant different behavior even when both use 429.
Give each state a different message
For no match, explain which filters were used and let the caller decide whether to broaden them. For a rate limit, surface any available delay or reset information. For an unexpected response, log enough to investigate the contract without logging credentials or complete response payloads. Metrics that count these states separately help you tell whether users are requesting rare combinations or the integration is failing.
Disclosure: Oddbench operates both GimmeProxy and the IP-API.io account publishing this article. This article was generated with AI.