Fetch the Record Based on Query

Introduction

This API allows you to fetch the record based on the query. Please read the following instructions carefully so you can make successful requests.

Base URL

The base URL for all API requests is:

Domain URL
api.odin.ioapi.odin.io/v1

The endpoint for host search is:

/hosts/search

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:

To search for host count based on specific criteria, send a POST request to the following URL:

https://api.odin.io/v1/hosts/search/

Include the following parameters in the request body:

Name Description
limitSpecifies the maximum number of hosts to return in the response. The default value is 10 if not provided.
querySpecifies the search query to filter hosts. The query should be provided in the following format: <field>:<value>. In this case, the query is based on the services.port field and the desired value is 80.

Example Request

{
    "limit": 9,
    "query": "services.port:\"80\""
}

CURL

curl --location 'https://api.odin.io/v1/hosts/search/' \
--header 'X-API-Key: V8qb6HJIRKY7tVH0sou90I7YX3pCuqLQfRLmUzxpQbY=' \
--header 'Content-Type: application/json' \
--data '{
"limit": 9,
"query": "services.port:\"80\""
}'

This cURL command is structured to perform an HTTP POST request to the https://api.odin.io/v1/hosts/search/ endpoint. Let's break down the components:

location: Instructs cURL to follow HTTP redirects if the response indicates a redirect.

header 'X-API-Key: V8qb6HJIRKY7tVH0sou90I7YX3pCuqLQfRLmUzxpQbY=': Sets the header for the API key. The key provided here is V8qb6HJIRKY7tVH0sou90I7YX3pCuqLQfRLmUzxpQbY='.

header 'Content-Type: application/json': Specifies that the content sent in the request body is in JSON format.

data '{ "limit": 9, "query": "services.port:\"80\"" }': Sends a JSON payload in the request body. The payload includes:

"limit": 9: Indicates that the response should include a maximum of 9 results.

"query": "services.port:\"80\"": Specifies the query parameter for searching hosts. It's looking for hosts where the port for services is specifically '80'.

Response Parameters

The API response will contain the following parameters:

Example Response

{
    "success": true,
    "pagination": {
        "start": null,
        "last": [
            1,
            1688639288692
        ],
        "limit": 9,
        "total": 64413010
    },
    "data": [{
                "asn": {
                    "country_code": null,
                    "number": "AS14909",
                    "organization": "JD-02"
                },
                "asn_updated_at": "0001-01-01T00:00:00Z",
                "domains": null,
                "hostnames": [{
                    "last_updated_at": "2023-07-06T10:28:11.695578083Z",
                    "name": "ec2-52-64-233-185.ap-southeast-2.compute.amazonaws.com"
                }],
                "ip": "8.8.8.8",
                "is_ipv4": true,
                "is_ipv6": false,
                "last_updated_at": "2023-07-06T10:28:11.69574756Z",
                "location": {
                    "city": "XYZ",
                    "continent": "ABC",
                    "coordinates": {
                        "latitude": "-33.8715",
                        "longitude": "151.2006"
                    },
                    "country_code": "AB",
                    "country_name": "XYZ",
                    "geo_point": "-33.8715, 151.2006",
                    "locale_code": "en",
                    "network": "8.8.8.8/12",
                    "postal_code": "2000"
                },
                "location_updated_at": "2023-07-06T05:46:44Z",
                "scan_id": 1683276692,
                "services": [{
                    "_meta": {
                        "category": "",
                        "desc": "",
                        "name": "http",
                        "tags": null
                    },
                    "extra_info": "",
                    "last_updated_at": "2023-05-06T06:20:56.004Z",
                    "modules": {
                        "http": {
                            "content_length": 564,
                            "headers": {
                                "connection": [
                                    "keep-alive"
                                ],
                                "content_length": [
                                    "564"
                                ],
                                "content_type": [
                                    "text/html"
                                ],
                                "date": [
                                    "Sat, 06 May 2023 12:10:48 GMT"
                                ],
                                "server": [
                                    "awselb/2.0"
                                ]
                            },
                            "protocol": "HTTP/1.1",
                            "redirects": [{
                                "content_length": 134,
                                "location": "https://8.8.8.8:443/",
                                "status_code": 301,
                                "status_line": "301 Moved Permanently"
                            }],
                            "status_code": 503,
                            "transfer_encoding": null
                        }
                    },
                    "name": "http",
                    "port": 80,
                    "product": "awselb/2.0",
                    "protocol": "tcp",
                    "softwares": [],
                    "tunnel": "",
                    "version": ""
                }],
                "services_hash": "f18c9708017e2851cbedab20dafa98b14e59e866da4e41f811431a1627fb1c44",
                "tags": [{
                        "last_updated_at": "2023-07-06T10:27:54Z",
                        "name": "is_cdn",
                        "pretty_name": "CDN",
                        "value": false
                    },
                    {
                        "last_updated_at": "2023-07-06T05:46:44Z",
                        "name": "is_anonymous_proxy",
                        "pretty_name": "Anonymous Proxy",
                        "value": false
                    },
                    {
                        "last_updated_at": "2023-07-06T05:46:44Z",
                        "name": "is_satellite_provider",
                        "pretty_name": "Satellite Provider",
                        "value": false
                    }
                ],
                "whois": {
                    "_encoding": {
                        "raw": "BASE28"
                    },
                    "descr": "Jd EC2 SYD prefix",
                    "network": "52.64.196.0/17",
                    "organization": "Amazon EC2 SYD prefix",
                    "raw": null
                },
                "whois_updated_at": "2023-05-01T14:10:18Z"
            }]
}
Success A boolean value indicating the success status of the API request.
PaginationAn object containing pagination information for the search results.
  • start: Indicates the starting point of the results. In this case, it is set to null.
  • last: An array containing the results' last page number and timestamp.
  • limit: The maximum number of hosts returned per page.
  • total: The total number of hosts matching the search criteria.
Data An array containing the host information.
asn An object representing the Autonomous System Number (ASN) information for the host.
  • country_code: The country code associated with the ASN.
  • number: The ASN number.
  • organisation: The organisation associated with the ASN.
  • asn_updated_at: The timestamp when the ASN information was last updated.
  • domains: An array of domains associated with the host.
hostnames An array of hostnames associated with the host.
  • last_updated_at: The timestamp when the hostname was last updated.
  • name: The hostname.
  • ip: The IP address of the host.
  • is_ipv4: A boolean indicating whether the IP address is an IPv4 address.
  • is_ipv6: A boolean indicating whether the IP address is an IPv6 address.
  • last_updated_at: The timestamp when the host information was last updated.
Location An object representing the geographical location information of the host.
  • city: The city where the host is located.
  • continent: The continent where the host is located.
  • coordinates: The latitude and longitude coordinates of the host.
  • country_code: The country code associated with the host.
  • country_name: The name of the country where the host is located.
  • geo_point: The geographical coordinates of the host in latitude, longitude format.
  • locale_code: The locale code associated with the host.
  • network: The network range associated with the host.
  • postal_code: The postal code of the host's location.
  • location_updated_at: The timestamp when the location information was last updated.
  • scan_id: The unique identifier for the scan associated with the host.
Services An array of services running on the host.
meta Meta information about the service.
  • category: The category of the service.
  • desc: A description of the service.
  • name: The name of the service.
  • tags: Additional tags associated with the service.
  • extra_info: Additional information about the service.
  • last_updated_at: The timestamp when the service information was last updated.
  • modules: An object containing modules associated with the service.
  • name: The name of the service
  • port: The port number of the service.
  • product: The product associated with the service.
  • protocol: The protocol used by the service.
  • softwares: An array of software associated with the service.
  • tunnel: Information about any tunneling associated with the service.
  • version: The version of the service.
  • services_hash: A hash value representing the services running on the host.
tags Contains an array of objects representing tags associated with the entity.
  • last_updated_at (string): The timestamp when the tag information was last updated.
  • name (string): The name of the tag.
  • pretty_name (string): A human-readable name for the tag.
  • value (boolean): The value associated with the tag.
whois Contains details about the encoding used for WHOIS data.
  • raw (string): The encoding type used for the raw WHOIS data.
  • descr (string): Description of the WHOIS record.
  • network (string): The network associated with the WHOIS record.
  • organisation (string): The organisation associated with the WHOIS record.
  • raw (null): Raw WHOIS data (in this case, it is null).

whois_updated_at

The timestamp when the WHOIS information was last updated.

Previous
Fetch IP CVE Details
ODIN logo
LinkedIn IconDiscord IconGitHub IconMedium IconX Icon