# IP Lookup Service

### Features of IP Lookup

* **Geolocation Details**: Discover the geographical location of any IP address.
* **Security Assessments**: Identify potential security threats linked to IP addresses.
* **Connection Insights**: Determine the type of connection (residential, business, mobile) an IP is associated with.

<mark style="color:green;">`POST`</mark> `https://api.localmail.io/v1/lookup/ip/`

The IP Lookup API provides detailed information about an IP address, including domain association, geographical location, and network information.

#### Request Body

| Name                                          | Type   | Description                                                                                                                   |
| --------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| ip\_address<mark style="color:red;">\*</mark> | String | Format: Must be a valid IPv4 or IPv6 address. Example: "192.168.1.1" (IPv4), "2001:0db8:85a3:0000:0000:8a2e:0370:7334" (IPv6) |

{% tabs %}
{% tab title="200: OK " %}

```
{
  "ip": "104.28.233.84",
  "domain": "exampledomain.com",
  "asn": "ASxxxxx",
  "asn_organization": "Example Organization",
  "country": "Example Country",
  "continent": "Example Continent",
  "reason": "",
  "name_official": "Official Country Name",
  "calling_codes": "+xx",
  "currencies": "XXX",
  "region": "Example Region",
  "sub_region": "Example Sub-Region",
  "capital": "Capital City",
  "languages": "Language1,Language2"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```
{
  "error_code": 100,
  "message": "Invalid IP address format."
}
```

{% endtab %}
{% endtabs %}

### Response Format

Upon a successful request, the API will return a JSON object containing the following information:

* `ip`: IP address queried.
* `domain`: Associated domain name (if any).
* `asn`: Autonomous System Number.
* `asn_organization`: Organization associated with the ASN.
* `country`: Country where the IP is located.
* `continent`: Continent of the IP location.
* `reason`: Additional details or reasons (if applicable).
* `name_official`: Official name of the country.
* `calling_codes`: Country calling code(s).
* `currencies`: Currency code(s) used in the country.
* `region`: General region where the IP is located.
* `sub_region`: Specific sub-region of the IP location.
* `capital`: Capital city of the country.
* `languages`: Languages spoken in the region.

### Error Responses

* **400 Bad Request**: Invalid IP address format.
* **401 Unauthorized**: Access token is missing or invalid. (Only for premium users)
* **404 Not Found**: IP address not found in the database.
* **500 Internal Server Error**: Unexpected server error.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.localmail.io/localmail-insights-lookup/ip-lookup-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
