Check IP Address
Retrieves threat intelligence and reputation details for a given IP address.
Endpoint
http
GET /api/v1/checkIPRequest
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes* | Bearer <api-key> |
X-API-Key | Yes* | Alternative to Authorization header |
INFO
One of Authorization or X-API-Key is required.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ip | string | Yes | The IP address to check (IPv4 or IPv6) |
Response
Success (200)
Returns threat intelligence data and geographic information for the requested IP address.
json
{
"message": "IP is whitelisted",
"description": "Cloudflare DNS",
"details": {
"score": 0,
"ip": "1.1.1.1",
"last_attack": "",
"total_hits": 0
},
"ipInfo": {
"ip": "1.1.1.1",
"asn": "AS13335",
"as_name": "Cloudflare, Inc.",
"as_domain": "cloudflare.com",
"country_code": "AU",
"country": "Australia",
"continent_code": "OC",
"continent": "Oceania"
}
}Response Fields
Details Object
| Field | Type | Description |
|---|---|---|
score | number | Threat score (0-100, higher is more dangerous) |
ip | string | The queried IP address |
last_attack | string | ISO timestamp of last detected attack |
ip_rep | string | Reputation classification (e.g., known attacker, suspicious) |
total_hits | number | Total number of malicious hits recorded |
IPInfo Object
| Field | Type | Description |
|---|---|---|
ip | string | The IP address |
asn | string | Autonomous System Number |
as_name | string | AS organization name |
as_domain | string | Domain associated with the AS |
country_code | string | ISO country code (e.g., "US") |
country | string | Full country name |
continent_code | string | Continent code (e.g., "NA") |
continent | string | Full continent name |
Error Responses
| Status | Response | Description |
|---|---|---|
400 | { "error": true, "statusCode": 400, "message": "IP address is required" } | Missing IP parameter |
401 | { "error": true, "statusCode": 401, "message": "API key required..." } | No API key provided |
403 | { "error": true, "statusCode": 403, "message": "Invalid API key" } | Invalid or expired API key |
500 | { "error": true, "statusCode": 500, "message": "Failed to fetch IP details" } | Internal server error |
Examples
Basic Request
bash
curl -X GET "https://ipswamp.com/api/v1/checkIP?ip=1.1.1.1" \
-H "Authorization: Bearer your-api-key-here"Using X-API-Key Header
bash
curl -X GET "https://ipswamp.com/api/v1/checkIP?ip=1.1.1.1" \
-H "X-API-Key: your-api-key-here"JavaScript/TypeScript
typescript
const response = await fetch("https://ipswamp.com/api/v1/checkIP?ip=1.1.1.1", {
headers: {
Authorization: "Bearer your-api-key-here",
},
});
const data = await response.json();
console.log(data);Python
python
import requests
url = "https://ipswamp.com/api/v1/checkIP"
params = {"ip": "1.1.1.1"}
headers = {
"Authorization": "Bearer your-api-key-here"
}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(data)Rate Limiting
WARNING
Each API call increments your usage counter. Monitor your usage via the test-key endpoint.
See Authentication for more information about rate limits and usage.