Skip to content

feat: add missing PlusAnonymous fields and fix PlusMobile#73

Merged
silvanocerza merged 2 commits intoipinfo:masterfrom
rbarrielabrystech:feat/plus-anonymous-extended-fields
Mar 26, 2026
Merged

feat: add missing PlusAnonymous fields and fix PlusMobile#73
silvanocerza merged 2 commits intoipinfo:masterfrom
rbarrielabrystech:feat/plus-anonymous-extended-fields

Conversation

@rbarrielabrystech
Copy link
Copy Markdown
Contributor

Summary

  • PlusAnonymous: Add IsResProxy, LastSeen, and PercentDaysSeen fields to match the IPinfo Max /lookup API response
  • PlusMobile: Replace incorrect Name field with CountryCode to match actual API response schema

Context

The IPinfo Max /lookup endpoint returns these fields in the anonymous object:

{
  "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 PlusAnonymous struct 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.Name doesn't exist in the API response — the actual field is country_code.

Changes

  1. ipinfo/plus.go: Added 3 new fields to PlusAnonymous, replaced Name with CountryCode in PlusMobile
  2. example/lookup-plus/main.go: Updated example to demonstrate the new fields

Testing

  • Tested against live IPinfo Max API — all new fields correctly populated
  • go build ./... passes cleanly
  • Backwards compatible for PlusAnonymous; PlusMobile.Name.CountryCode is a correctness fix (Name was always empty)

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"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, thanks. 🙏

@silvanocerza silvanocerza merged commit cee8a0b into ipinfo:master Mar 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants