Skip to content

Latest commit

 

History

History
234 lines (200 loc) · 4.73 KB

README.md

File metadata and controls

234 lines (200 loc) · 4.73 KB

IP Analyzer

API documentation
Back to Home »

Table of Contents
  1. Introduction
  2. Authentication
  3. Service Status
  4. IP info API

Introduction

IP Analyzer accepts TCP request with JSON encoded payload. All payload will pass through basic validation.


Authentication

If you have enabled the optional API password authentication in env, you should append the password with auth as key in the payload.

{
    "ip": "1.1.1.1",
    "auth": "password"
}

Service Status API

Name Type Description
ping any Ping service
{
    "ping": null
}

Success Response

{
   "status": "success",
   "data": null,
   "message": "pong"
}
Name Type Description
status any Get service status

Status API is only available when any of the following conditions are met:

  • IP Analyzer is running in single worker mode
  • Redis integration is enabled
{
    "status": null
}

Success Response

{
   "status": "success",
   "data": {
       "analyzed": 10,
       "failed": 1
   },
   "message": null
}

Failed Response

{
   "status": "error",
   "data": null,
   "message": "Redis store or running in single worker is required"
}

IP info API

Get info on a single IP address

Name Type Description
ip string an IPv4/IPv6 string

Get geo info on an IP address

{
    "ip": "128.101.101.101"
}

Success Response

{
    "status": "success",
    "data": {
        "code": "NA",
        "continent": "North America",
        "iso": "US",
        "country": "United States",
        "isEU": false,
        "city": "Minneapolis",
        "postal": "55423",
        "div": "Minnesota",
        "divIso": "MN",
        "accuracy": 20,
        "lat": 44.8769,
        "long": -93.2535,
        "timezone": "America\/Chicago"
    },
    "message": null
}

Please see Maxmind API docs for details on these returned data

If you have enabled the IPsum integration, a threat number will be included in analysis result. The greater the number, the higher chance it might be a credible threat.

{
    "status": "success",
    "data": {
        ...
        "threat": 5
    },
    "message": null
}

Failed Response

{
   "status": "error",
   "data": null,
   "message": "invalid ip"
}

Get info on a list of IP addresses

Name Type Description
iplist array an array of IPv4/IPv6 string(s) (max. 100 items)

Get geo info on a list of IP address

{
    "iplist": [
        "128.101.101.101",
        "128.101.101.102",
        "128.101.101.103"
    ]
}

Success Response

{
    "status": "success",
    "data": {
        "128.101.101.101": {
            "code": "NA",
            "continent": "North America",
            "iso": "US",
            "country": "United States",
            "isEU": false,
            "city": "Minneapolis",
            "postal": "55423",
            "div": "Minnesota",
            "divIso": "MN",
            "accuracy": 20,
            "lat": 44.8769,
            "long": -93.2535,
            "timezone": "America\/Chicago"
        },
        "128.101.101.102": {
            "code": "NA",
            "continent": "North America",
            "iso": "US",
            "country": "United States",
            "isEU": false,
            "city": "Minneapolis",
            "postal": "55423",
            "div": "Minnesota",
            "divIso": "MN",
            "accuracy": 20,
            "lat": 44.8769,
            "long": -93.2535,
            "timezone": "America\/Chicago"
        },
        "128.101.101.103": {
            "code": "NA",
            "continent": "North America",
            "iso": "US",
            "country": "United States",
            "isEU": false,
            "city": "Minneapolis",
            "postal": "55423",
            "div": "Minnesota",
            "divIso": "MN",
            "accuracy": 20,
            "lat": 44.8769,
            "long": -93.2535,
            "timezone": "America\/Chicago"
        }
    },
    "message": null
}

Please see Maxmind API docs for details on these returned data