# IPs ## Get IP Overview `client.Intel.IPs.Get(ctx, params) (*[]IP, error)` **get** `/accounts/{account_id}/intel/ip` Gets the geolocation, ASN, infrastructure type of the ASN, and any security threat categories of an IP address. **Must provide ip query parameters.** For example, `/intel/ip?ipv4=1.1.1.1` or `/intel/ip?ipv6=2001:db8::1`. ### Parameters - `params IPGetParams` - `AccountID param.Field[string]` Path param: Identifier. - `IPV4 param.Field[string]` Query param - `IPV6 param.Field[string]` Query param ### Returns - `type IPGetResponseEnvelopeResult []IP` - `BelongsToRef IPBelongsToRef` Specifies a reference to the autonomous systems (AS) that the IP address belongs to. - `ID string` - `Country string` - `Description string` - `Type IPBelongsToRefType` Infrastructure type of this ASN. - `const IPBelongsToRefTypeHostingProvider IPBelongsToRefType = "hosting_provider"` - `const IPBelongsToRefTypeISP IPBelongsToRefType = "isp"` - `const IPBelongsToRefTypeOrganization IPBelongsToRefType = "organization"` - `Value string` - `IP string` - `RiskTypes []IPRiskType` - `ID float64` - `Name string` - `SuperCategoryID float64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/intel" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) ips, err := client.Intel.IPs.Get(context.TODO(), intel.IPGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", ips) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "belongs_to_ref": { "id": "autonomous-system--2fa28d71-3549-5a38-af05-770b79ad6ea8", "country": "US", "description": "CLOUDFLARENET", "type": "hosting_provider", "value": "value" }, "ip": "192.0.2.0", "risk_types": [ { "id": 131, "name": "Phishing", "super_category_id": 21 } ] } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Domain Types ### IP - `type IP struct{…}` - `BelongsToRef IPBelongsToRef` Specifies a reference to the autonomous systems (AS) that the IP address belongs to. - `ID string` - `Country string` - `Description string` - `Type IPBelongsToRefType` Infrastructure type of this ASN. - `const IPBelongsToRefTypeHostingProvider IPBelongsToRefType = "hosting_provider"` - `const IPBelongsToRefTypeISP IPBelongsToRefType = "isp"` - `const IPBelongsToRefTypeOrganization IPBelongsToRefType = "organization"` - `Value string` - `IP string` - `RiskTypes []IPRiskType` - `ID float64` - `Name string` - `SuperCategoryID float64`