4.2 Scanning list of IPs
Request |
Value |
Method |
POST |
URL |
https://api.metadefender.com/v3/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 |
Authorization |
Give rights to use the endpoint (API Authentication Mechanisms) |
apikey |
YES |
content-type |
|
application/json |
YES |
Response
HTTP Status Codes
Please refer to Status Codes for more information.
Body
Example of successful scan request:
{
"success"
:
true
,
"data"
: [
{
"start_time"
:
"2018-11-13T11:51:45.095Z"
,
"scan_results"
: [
{
"source"
:
"www.chaosreigns.com"
,
"results"
: [
{
"alternativeid"
:
""
,
"assessment"
:
""
,
"confident"
:
""
,
"detecttime"
:
""
,
"updatetime"
:
"2018-11-13T11:51:47.120Z"
,
"result"
:
"unknown"
}
]
},
{
"source"
:
"dragonresearchgroup.org"
,
"results"
: [
{
"alternativeid"
:
""
,
"assessment"
:
""
,
"confident"
:
""
,
"detecttime"
:
""
,
"updatetime"
:
"2018-11-13T11:51:47.120Z"
,
"result"
:
"unknown"
}
]
},
{
"source"
:
"malc0de.com"
,
"results"
: [
{
"alternativeid"
:
""
,
"assessment"
:
""
,
"confident"
:
""
,
"detecttime"
:
""
,
"updatetime"
:
"2018-11-13T11:51:47.120Z"
,
"result"
:
"unknown"
}
]
},
{
"source"
:
"www.us.openbl.org"
,
"results"
: [
{
"alternativeid"
:
""
,
"assessment"
:
""
,
"confident"
:
""
,
"detecttime"
:
""
,
"updatetime"
:
"2018-11-13T11:51:47.120Z"
,
"result"
:
"unknown"
}
]
}
],
"detected_by"
:
0
,
"address"
:
"2001:0000:0234:C1AB:0000:00A0:AABC:003F"
,
"geo_info"
: {
"continent"
: {
"code"
:
"AS"
,
"geoname_id"
:
6255147
,
"names"
: {
"de"
:
"Asien"
,
"en"
:
"Asia"
,
"es"
:
"Asia"
,
"fr"
:
"Asie"
,
"ja"
:
"アジア"
,
"pt-BR"
:
"Ásia"
,
"ru"
:
"Азия"
,
"zh-CN"
:
"亚洲"
}
},
"country"
: {
"geoname_id"
:
294640
,
"iso_code"
:
"IL"
,
"names"
: {
"de"
:
"Israel"
,
"en"
:
"Israel"
,
"es"
:
"Israel"
,
"fr"
:
"Israël"
,
"ja"
:
"イスラエル国"
,
"pt-BR"
:
"Israel"
,
"ru"
:
"Израиль"
,
"zh-CN"
:
"以色列"
}
},
"location"
: {
"latitude"
:
31.5
,
"longitude"
:
34.75
,
"time_zone"
:
"Asia/Jerusalem"
},
"registered_country"
: {
"geoname_id"
:
294640
,
"iso_code"
:
"IL"
,
"names"
: {
"de"
:
"Israel"
,
"en"
:
"Israel"
,
"es"
:
"Israel"
,
"fr"
:
"Israël"
,
"ja"
:
"イスラエル国"
,
"pt-BR"
:
"Israel"
,
"ru"
:
"Израиль"
,
"zh-CN"
:
"以色列"
}
}
}
}
]
}
Example of list address as null or empty:
{
"err"
:
"The `address` field is empty"
}
Example of header being invalid:
{
"err"
:
"Content-Type header & payload has to be json"
}
Example of input body as wrong format:
{
"err"
:
"Invalid format of input. Provide IPv4 or IPv6"
}
Example of maximum address input:
{
"err"
:
"Exceeded maximum allowed. Allow maximum 50 observables"
}
Example of no valid input address:
[]
Descriptions of responses:
data |
The information from the database. |
success |
Boolean value representing whether the request was successfully resolved or not. |
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"
: [
"v3"
,
"ip"
,
""
],
"headers"
: {
"Authorization"
:
"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'
,
'198.15.127.171'
] }));
req.end();
Sample code (cURL)
curl -X POST \
https:
//api.metadefender.com/v3/ip/ \
-H
'Authorization: apikey ${APIKEY}'
\
-H
'content-type: application/json'
\
-d
'{"address":["198.15.127.170","198.15.127.171"]}'