4.2 Scanning list of IPs

Request

Value

Method

POST

URL

https://api.metadefender.com/v4/ip/

Throttled

Yes

Summary

Retrieve information about given observables (IPv4/IPv6).

Request

Request body

The maximum number of observables that can be requested at once using the bulk IP lookup is 50.

{
"address":["198.15.127.170"]
}
{
{ "address":["2001:0000:0234:C1AB:0000:00A0:AABC:003F", "104.247.219.41", "176.107.191.119", "188.219.154.228"] }
}

Header Parameters

 

Description

Allowed Values

Required

apikey

Gives rights to use the endpoint (API Authentication Mechanisms)

apikey

YES

content-type

Specify the http content type

application/json

NO

Response

HTTP Status Codes

Please refer to Status Codes for more information.

Body

Example of a successful request:

{
"data": [
{
"address": "198.15.127.170",
"lookup_results": {
"start_time": "2019-02-28T12:01:59.979Z",
"detected_by": 1,
"sources": [
{
"provider": "zeustracker.abuse.ch",
"assessment": "botnet, zeus",
"detect_time": "2019-02-20T11:39:49.612487Z",
"update_time": "2019-02-20T11:39:49.764370",
"status": 1
},
{
"provider": "danger.rulez.sk",
"assessment": "",
"detect_time": "",
"update_time": "2019-02-28T12:02:00.129Z",
"status": 0
},
{
"provider": "feodotracker.abuse.ch",
"assessment": "",
"detect_time": "",
"update_time": "2019-02-28T12:02:00.129Z",
"status": 0
},
{
"provider": "malc0de.com",
"assessment": "",
"detect_time": "",
"update_time": "2019-02-28T12:02:00.129Z",
"status": 0
},
{
"provider": "malwaredomainlist.com",
"assessment": "",
"detect_time": "",
"update_time": "2019-02-28T12:02:00.129Z",
"status": 0
},
{
"provider": "phishtank.com",
"assessment": "",
"detect_time": "",
"update_time": "2019-02-28T12:02:00.129Z",
"status": 0
},
{
"provider": "spamhaus.org",
"assessment": "",
"detect_time": "",
"update_time": "2019-02-28T12:02:00.129Z",
"status": 0
}
]
},
"geo_info": {
"continent": {
"code": "NA",
"name": "North America"
},
"country": {
"code": "US",
"name": "United States"
},
"city": {
"code": "",
"name": "Tempe"
},
"location": {
"latitude": 33.4357,
"longitude": -111.9171
},
"registered_country": {
"code": "US",
"name": "United States"
},
"subdivisions": [
{
"code": "AZ",
"name": "Arizona"
}
]
}
}
]
}

Example of a wrong format of input body:

{
"error": {
"code": 400180,
"messages": [
"Invalid format of input. Provide IPv4 or IPv6"
]
}
}

Descriptions of responses:

data

The information from the database.

success

A boolean value representing whether the request was successfully resolved or not.

address

This is usually an IP address, URI that is found in feeds of data but is not limited to those data types.

geo_info

Geolocation of address.

detected_by

The number of blacklisted sources.

sources

Source of the feed, usually the domain where the feed is from (e.g., example.com ).

Errors

Please refer to Errors for more information.

Sample code (Node.js)

var http = require("https");
 
var options = {
"method": "POST",
"hostname": [
"api",
"metadefender",
"com"
],
"path": [
"v4",
"ip",
""
],
"headers": {
"apikey": process.env.APIKEY,
"Content-Type": "application/json",
}
};
 
var req = http.request(options, function (res) {
var chunks = [];
 
res.on("data", function (chunk) {
chunks.push(chunk);
});
 
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
 
req.write(JSON.stringify({ address: [ '198.15.127.170' ] }));
req.end();

Sample code (cURL)

curl -X POST \
https://api.metadefender.com/v4/ip/ \
-H 'Content-Type: application/json' \
-H "apikey: ${APIKEY}"
-d '{
"address":["198.15.127.170"]
}'