# IP Lookup

## REQUEST

### Endpoint

```url
https://stopbot.net/api/iplookup?apikey={APIKEY}&ip={IP}
```

### Method

```
GET
```

### Parameters

* `apikey` (string, required): The API key provided to the user.
* `ip` (string, required): The IP address of the visitor.

### Example Request

```bash
curl "https://stopbot.net/api/iplookup?apikey=9ca6f45b2e9821b3a964c0f79cb67dc3&ip=1.1.1.1"
```

## **Example Response**

### Success Response

If the HTTP response is 200 (success response), it will generate the following response:

```json
{
  "ip": "1.1.1.1",
  "hostname": "",
  "asn": 13335,
  "company": "Cloudflare, Inc.",
  "isp": "Cloudflare, Inc.",
  "city": "Marble Bar",
  "district": "East Pilbara",
  "region": "Western Australia",
  "postcode": "",
  "country": "Australia",
  "countryCode": "AU",
  "latitude": -20.5,
  "longitude": 120.15,
  "timezone": "Australia\/Perth",
  "status": "success",
  "timeResponse": "2023-07-21 03:55:57"
}
```

### Description on successful response

* `hostname`: The visitor's hostname.
* `asn`: The Autonomous System Number (ASN) that identifies the internet service provider.
* `company`: The company associated with the visitor's IP.
* `isp`: The Internet Service Provider (ISP) name.
* `city`: The city where the visitor is located.
* `district`: The district or area associated with the IP address.
* `region`: The region where the visitor is located.
* `postcode`: The postal code associated with the IP address.
* `country`: The country where the visitor is located.
* `countryCode`: The ISO-3166 alpha-2 country code.
* `latitude`: The latitude coordinate of the IP address location.
* `longitude`: The longitude coordinate of the IP address location.
* `timezone`: The timezone of the IP address location.

### Failed Response

If the HTTP response is 400 or 401 (failed response), it will generate the following response:

```json
{
  "status": "failed",
  "timeResponse": "2023-06-8 23:00"
}
```

### Description on failed response:

* `status`: Response Status: The value is "failed" if the request fails.
* `timeResponse`: Date and time when the response was sent.


---

# 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.stopbot.net/api-documentation/ip-lookup.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.
