Documentation

 

Documentation


  1. API
  2. The API has a rate limit implemented.
    The limit and remaining limit will be sent in the headers with each request as 'X-RateLimit-Limit' and 'X-RateLimit-Remaining'
    When you reach the limit of API requests, you will receive a response with error code '429' and message 'Too many attempts.'
    There will also be a response added to the header 'Retry-After' which indicates the amount of seconds before your limit will reset again.
    By default, you are allowed to do 240 requests per minute.

    Here is a list of API commands with required and optional parameters.

    /api/report
    POST

    Report an IP Address. Special permission required

    Parameters:

    • "api_token" your api token required
    • "ip" the ip address to report (IPv4 or IPv6) required
    • "reason" the reason the ip adress is being reported. required

    Responses:

    • 200 {"message":"Reported successfully"}
    • 401 {"error":"Not authorized"}
    • 422 {"error":"Error in request"}
    /api/ip
    GET

    Fetch information about an IP Address.

    Parameters:

    • "api_token" your api token required
    • "ip" the ip address you wish to fetch information about (IPv4 or IPv6) required

    Responses:

    • 200 {"ip":(string),"country_code":(string),"country_name":(string),"region_code":(string),"region_name":(string),"city":(string),"zip_code":(string),"time_zone":(string),"latitude":(float),"longitude":(float),"metro_code":(string),"first_seen":{"date":(timestamp),"timezone_type":(int),"timezone":(string)},"last_seen":{"date":(timestamp),"timezone_type":(int),"timezone":(string)},"registered_events":(int),"events":[{"reason":(string),"target_country_code":(string),"target_country_name":(string),"time":{"date":(timestamp),"timezone_type":(int),"timezone":(string)}}]}
    • 401 {"error":"Not authorized"}
    /api/ips
    GET

    Get a list of listed IP addresses.

    Parameters:

    • "api_token" your api token required
    • "limit" The number of records returned per query default: 25 - maximum: 250
    • "page" The page number of records returned default: 1
    • "sort" Sort the records by "last_report", "country" default: "last_report"

    Responses:

    • 200 [{"ip":(string),"country_code":(string),"country_name":(string),"region_code":(string),"region_name":(string),"city":(string),"zip_code":(string),"time_zone":(string),"latitude":(float),"longitude":(float),"metro_code":(string),"first_seen":{"date":(timestamp),"timezone_type":(int),"timezone":(string)},"last_seen":{"date":(timestamp),"timezone_type":(int),"timezone":(string)},"registered_events":(int),"events":[{"reason":(string),"target_country_code":(string),"target_country_name":(string),"time":{"date":(timestamp),"timezone_type":(int),"timezone":(string)}}]}]
    • 401 {"error":"Not authorized"}