---
title: "Get all hosts for your organization"
method: GET
path: "/api/v1/hosts"
tags: ["Hosts"]
---

# Get all hosts for your organization

`GET /api/v1/hosts`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v1/hosts`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `hosts_read`

This endpoint allows searching for hosts by name, alias, or tag.
Hosts live within the past 3 hours are included by default.
Retention is 7 days.
Results are paginated with a max of 1000 results at a time.
**Note:** If the host is an Amazon EC2 instance, `id` is replaced with `aws_id` in the response.
**Note**: To enrich the data returned by this endpoint with security scans, see the new [api/v2/security/scanned-assets-metadata](https://docs.datadoghq.com/api/latest/security-monitoring/#list-scanned-assets-metadata) endpoint.

## Query parameters

- `filter` string
- `sort_field` string
- `sort_dir` string
- `start` integer
- `count` integer
- `from` integer
- `include_muted_hosts_data` boolean
- `include_hosts_metadata` boolean

## Response `200`

OK

- HostListResponse: Response with Host information from Datadog.
  - `host_list` Host[]: Array of hosts.
    - `aliases` string[]: Host aliases collected by Datadog.
    - `apps` string[]: The Datadog integrations reporting metrics for the host.
    - `aws_name` string: AWS name of your host.
    - `host_name` string: The host name.
    - `id` integer: The host ID.
    - `is_muted` boolean: If a host is muted or unmuted.
    - `last_reported_time` integer: Last time the host reported a metric data point.
    - `meta` HostMeta: Metadata associated with your host.
      - `agent_checks` AgentCheck[]: A list of Agent checks running on the host.
        - unknown[]: Array of strings.
          - unknown
      - `agent_version` string: The Datadog Agent version.
      - `cpuCores` integer: The number of cores.
      - `fbsdV` string[]: An array of Mac versions.
      - `gohai` string: JSON string containing system information.
      - `install_method` HostMetaInstallMethod: Agent install method.
        - `installer_version` string: The installer version.
        - `tool` string: Tool used to install the agent.
        - `tool_version` string: The tool version.
      - `macV` string[]: An array of Mac versions.
      - `machine` string: The machine architecture.
      - `nixV` string[]: Array of Unix versions.
      - `platform` string: The OS platform.
      - `processor` string: The processor.
      - `pythonV` string: The Python version.
      - `socket-fqdn` string: The socket fqdn.
      - `socket-hostname` string: The socket hostname.
      - `winV` string[]: An array of Windows versions.
    - `metrics` HostMetrics: Host Metrics collected.
      - `cpu` number, double: The percent of CPU used (everything but idle).
      - `iowait` number, double: The percent of CPU spent waiting on the IO (not reported for all platforms).
      - `load` number, double: The system load over the last 15 minutes.
    - `mute_timeout` integer, nullable: Timeout of the mute applied to your host.
    - `name` string: The host name.
    - `sources` string[]: Source or cloud provider associated with your host.
    - `tags_by_source` object: List of tags for each source (AWS, Datadog Agent, Chef..).
    - `up` boolean: Displays UP when the expected metrics are received and displays `???` if no metrics are received.
  - `total_matching` integer: Number of host matching the query.
  - `total_returned` integer: Number of host returned.

## Other responses

- `400`: Invalid Parameter Error
- `403`: Forbidden
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v1-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/revisions/ca5871004d26?raw)
