Skip to content

IP Reputation Badge

Embed a live IP reputation badge as an SVG image on any website or README. No authentication required.

Endpoint

http
GET https://ipswamp.com/api/public/badge

Public Endpoint

This is a public endpoint. No API key or authentication is required.

Request

Query Parameters

ParameterTypeRequiredDescriptionDefault
ipstringYesThe IP address to check (IPv4 or IPv6)
stylestringNoBadge style: shield or flatshield

Response

Returns an SVG image with Content-Type: image/svg+xml. The badge displays the threat level and score for the requested IP address.

Threat Level Colors

Threat LevelColorHex Code
LOWGreen#22c55e
MEDIUMYellow#eab308
HIGHOrange#f97316
CRITICALRed#ef4444
UNKNOWNGray#6b7280

Embedding

HTML

html
<img
  src="https://ipswamp.com/api/public/badge?ip=1.2.3.4"
  alt="IPSwamp threat level for 1.2.3.4"
/>

With flat style:

html
<img
  src="https://ipswamp.com/api/public/badge?ip=1.2.3.4&style=flat"
  alt="IPSwamp threat level for 1.2.3.4"
/>

Markdown (GitHub, README)

markdown
![IPSwamp](https://ipswamp.com/api/public/badge?ip=1.2.3.4)

Rate Limiting

WARNING

This endpoint is rate-limited to 2 requests per minute per IP address.

Error Responses

StatusResponseDescription
400SVG badge with "IP REQUIRED"Missing or invalid IP
429{ "error": true, "statusCode": 429, "message": "Rate limit exceeded..." }2/min limit hit

Examples

HTML Page

html
<!DOCTYPE html>
<html>
  <head>
    <title>IP Reputation Check</title>
  </head>
  <body>
    <h2>IPSwamp Reputation Badge</h2>
    <p>Threat level for 1.2.3.4:</p>
    <img
      src="https://ipswamp.com/api/public/badge?ip=1.2.3.4"
      alt="IPSwamp threat level"
    />
    <p>Flat style:</p>
    <img
      src="https://ipswamp.com/api/public/badge?ip=1.2.3.4&style=flat"
      alt="IPSwamp threat level"
    />
  </body>
</html>

Dynamic IP in JavaScript

typescript
function getBadgeUrl(ip: string, style: "shield" | "flat" = "shield"): string {
  return `https://ipswamp.com/api/public/badge?ip=${encodeURIComponent(ip)}&style=${style}`;
}

const badgeUrl = getBadgeUrl("80.94.92.164", "shield");
console.log(`Embed badge: <img src="${badgeUrl}" />`);

See Also

IPSwamp API Documentation