Skip to content

Check IP Address

Retrieves threat intelligence and reputation details for a given IP address.

Endpoint

http
GET /api/v1/checkIP

Request

Headers

HeaderRequiredDescription
AuthorizationYes*Bearer <api-key>
X-API-KeyYes*Alternative to Authorization header

INFO

One of Authorization or X-API-Key is required.

Query Parameters

ParameterTypeRequiredDescription
ipstringYesThe 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

FieldTypeDescription
scorenumberThreat score (0-100, higher is more dangerous)
ipstringThe queried IP address
last_attackstringISO timestamp of last detected attack
ip_repstringReputation classification (e.g., known attacker, suspicious)
total_hitsnumberTotal number of malicious hits recorded

IPInfo Object

FieldTypeDescription
ipstringThe IP address
asnstringAutonomous System Number
as_namestringAS organization name
as_domainstringDomain associated with the AS
country_codestringISO country code (e.g., "US")
countrystringFull country name
continent_codestringContinent code (e.g., "NA")
continentstringFull continent name

Error Responses

StatusResponseDescription
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.

IPSwamp API Documentation