# IPs ## Get IP Overview `intel.ips.get(IPGetParams**kwargs) -> IPGetResponse` **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 - `account_id: str` Identifier. - `ipv4: Optional[str]` - `ipv6: Optional[str]` ### Returns - `Optional[List[IP]]` - `belongs_to_ref: Optional[BelongsToRef]` Specifies a reference to the autonomous systems (AS) that the IP address belongs to. - `id: Optional[str]` - `country: Optional[str]` - `description: Optional[str]` - `type: Optional[Literal["hosting_provider", "isp", "organization"]]` Infrastructure type of this ASN. - `"hosting_provider"` - `"isp"` - `"organization"` - `value: Optional[str]` - `ip: Optional[str]` - `risk_types: Optional[List[RiskType]]` - `id: Optional[float]` - `name: Optional[str]` - `super_category_id: Optional[float]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) ips = client.intel.ips.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(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 - `class IP: …` - `belongs_to_ref: Optional[BelongsToRef]` Specifies a reference to the autonomous systems (AS) that the IP address belongs to. - `id: Optional[str]` - `country: Optional[str]` - `description: Optional[str]` - `type: Optional[Literal["hosting_provider", "isp", "organization"]]` Infrastructure type of this ASN. - `"hosting_provider"` - `"isp"` - `"organization"` - `value: Optional[str]` - `ip: Optional[str]` - `risk_types: Optional[List[RiskType]]` - `id: Optional[float]` - `name: Optional[str]` - `super_category_id: Optional[float]` ### IP Get Response - `Optional[List[IP]]` - `belongs_to_ref: Optional[BelongsToRef]` Specifies a reference to the autonomous systems (AS) that the IP address belongs to. - `id: Optional[str]` - `country: Optional[str]` - `description: Optional[str]` - `type: Optional[Literal["hosting_provider", "isp", "organization"]]` Infrastructure type of this ASN. - `"hosting_provider"` - `"isp"` - `"organization"` - `value: Optional[str]` - `ip: Optional[str]` - `risk_types: Optional[List[RiskType]]` - `id: Optional[float]` - `name: Optional[str]` - `super_category_id: Optional[float]`