feat: add missing PlusAnonymous fields and fix PlusMobile#73
Merged
silvanocerza merged 2 commits intoipinfo:masterfrom Mar 26, 2026
Merged
Conversation
PlusAnonymous: add IsResProxy, LastSeen, and PercentDaysSeen fields to match the IPinfo Max /lookup API response. These fields provide residential proxy detection and anonymiser recency/frequency signals that were previously silently dropped during JSON unmarshaling. PlusMobile: replace incorrect Name field with CountryCode to match the actual API response schema (the mobile object returns mcc, mnc, and country_code — not name). Update lookup-plus example to demonstrate the new fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ipinfo/plus.go
Outdated
| MNC string `json:"mnc,omitempty"` | ||
| MCC string `json:"mcc,omitempty"` | ||
| MNC string `json:"mnc,omitempty"` | ||
| CountryCode string `json:"country_code,omitempty"` |
Contributor
There was a problem hiding this comment.
This is wrong, the API returns only name, mcc and mnc in mobile.
| // PercentDaysSeen is the percentage of days the IP was seen using an | ||
| // anonymous service over the trailing 90 days. Higher values indicate | ||
| // more persistent anonymiser usage. | ||
| PercentDaysSeen int `json:"percent_days_seen"` |
Contributor
There was a problem hiding this comment.
This is good, thanks. 🙏
silvanocerza
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IsResProxy,LastSeen, andPercentDaysSeenfields to match the IPinfo Max/lookupAPI responseNamefield withCountryCodeto match actual API response schemaContext
The IPinfo Max
/lookupendpoint returns these fields in theanonymousobject:{ "anonymous": { "is_proxy": false, "is_relay": false, "is_tor": false, "is_vpn": true, "is_res_proxy": true, "name": "NetNut", "last_seen": "2026-03-12", "percent_days_seen": 100 } }The current
PlusAnonymousstruct only captures 5 of these 8 fields. The missing fields (is_res_proxy,last_seen,percent_days_seen) are silently dropped during JSON unmarshaling.Similarly,
PlusMobile.Namedoesn't exist in the API response — the actual field iscountry_code.Changes
ipinfo/plus.go: Added 3 new fields toPlusAnonymous, replacedNamewithCountryCodeinPlusMobileexample/lookup-plus/main.go: Updated example to demonstrate the new fieldsTesting
go build ./...passes cleanlyPlusAnonymous;PlusMobile.Name→.CountryCodeis a correctness fix (Name was always empty)