Hosts Summary
Introduction
The Odin Hosts Summary API provides a summary of hosts based on a specified field and returns the top results. This API allows you to retrieve information about the frequency of different ports used by hosts.
Base URL
The base URL for all API requests is:
Domain | URL |
---|---|
api.odin.io | api.odin.io/v1 |
The endpoint for host search is:
/hosts/summary/
Authentication
All requests to this API must include an authentication token in the headers. Use the following header for authentication:
X-API-Key: V8qb6HJIRKY7tVH0sou90I7YX3pCuqLQfRLmUzxpQbY=
Request Parameters
The API requires the following request parameter to be included in the request body:
https://api.odin.io/v1/hosts/summary/
Name | Type | Description |
---|---|---|
field | string | The field to summarise. |
limit | number | The number of results to get. |
Example Request
{
"field": "services.port",
"limit": 10
}
CURL
{
curl --location 'https://api.odin.io/v1/hosts/summary/' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: V8qb6HJIRKY7tVH0sou90I7YX3pCuqLQfRLmUzxpQbY=' \
--data '{
"field": "services.port",
"limit": 10
}'
}
This cURL command is structured to perform an HTTP POST request to https://api.odin.io/v1/hosts/summary/. It includes the following headers:
'Accept: application/json': Specifies that the client expects a JSON response.
'Content-Type: application/json': Indicates that the content in the request body is in JSON format.
'X-API-Key: V8qb6HJIRKY7tVH0sou90I7YX3pCuqLQfRLmUzxpQbY=': Provides the API key for authentication with the value 'V8qb6HJIRKY7tVH0sou90I7YX3pCuqLQfRLmUzxpQbY='.
data '{"field": "services.port", "limit": 10}': Sends a JSON payload in the request body. The payload specifies a summary request for the field 'services.port' with a limit of 10 results.
Response Parameters
The response from the Odin Hosts Summary API will be in JSON format and include the following fields:
Example Response
{
"success": true,
"data": {
"doc_count_error_upper_bound": 177735,
"sum_other_doc_count": 21823724,
"buckets": [
{
"doc_count": 64447741,
"key": 80
},
{
"doc_count": 45738441,
"key": 443
},
{
"doc_count": 15273728,
"key": 22
},
{
"doc_count": 64725123,
"key": 25
},
{
"doc_count": 4243892,
"key": 8443
},
{
"doc_count": 4033732,
"key": 21
},
{
"doc_count": 3778484,
"key": 3306
},
{
"doc_count": 3610703,
"key": 110
},
{
"doc_count": 3564515,
"key": 587
},
{
"doc_count": 2749020,
"key": 23
}
]
}
}
Success | Indicates whether the request was successful or not. |
data.doc_count_error_upper_bound | An approximate count of documents that encountered errors. |
data.sum_other_doc_count | The count of documents that do not match the returned buckets. |
data.buckets | The summarised buckets contain the frequency of hosts.
|