---
title: List application ID, host ID, instance ID
source: https://docs.newrelic.com/docs/apis/rest-api-v2/get-started/list-application-id-host-id-instance-id
---

New Relic's [APM](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/introduction-new-relic-apm) assigns IDs to entities related to an application. These are used to collect information about the operation and performance from different view points. These IDs can be returned via [New Relic's REST API](https://docs.newrelic.com/docs/apis/rest-api-v2/getting-started/introduction-new-relic-rest-api-v2).

The IDs may include:

-   Application ID `$APP_ID` for each instrumented app
-   Host ID `$HOST_ID` for each host
-   Instance ID `$INSTANCE_ID` if there are multiple instances of the app

To list any of these IDs in the [New Relic API Explorer](https://docs.newrelic.com/docs/apis/using-the-api-explorer), you need an [API key](https://docs.newrelic.com/docs/apis/rest-api-v2/getting-started/introduction-new-relic-rest-api-v2#api_key).

## Use the API Explorer [#use-api-explorer]

1.  Go to the **[API Explorer](https://api.newrelic.com/docs/)**.
2.  From the **Servers** dropdown, choose a US or EU-based API URL.
3.  Click **Authorize**, enter your user API key, and click **Authorize** again.
4.  Expand one of the available API functions: **GET**, **PUT**, **DELETE**.
5.  (Optional) Add **Parameters** values for your API call to filter the response (refer to the UI for descriptions and requirements for v2.)
6.  From the **Media type** dropdown, choose a format for your request: JSON or XML.
7.  Click **Try it out**, then **Execute**.

## List product IDs [#list-product-ids]

To return a list of all product IDs for a particular product:

1.  Click the `GET /applications.json` dropdown.
2.  Click **Try it out**, then **Execute**.
3.  Browse the response to view all product IDs.

Once you've located a specific product ID, copy it for later in your other REST API calls.

## List application IDs [#locating_app_id]

Each app monitored by an APM agent is assigned a name. A unique `$APP_ID` is also associated with that name. The `$APP_ID` is fundamental for retrieving APM information about your apps. For more information about listing and using the `$APP_ID`, and obtaining the summary data, see [Listing your app ID](https://docs.newrelic.com/docs/apis/rest-api-v2/application-examples-v2/listing-your-app-id-metric-data-v2).

## List host IDs [#locating_host_id]

The `$HOST_ID` is used to get APM data for a specific host running an app. A physical server may have more than one host. For example, a web server program running on a physical server may be configured to have more than one virtual host.

IDs for the host and physical server are not the same. Each host ID is unique and represents different items.

Use the `$HOST_ID` to retrieve summary metrics for the host as well as specific metric timeslice values. For more information about available metrics:

1.  Go to the [API Explorer](https://api.newrelic.com/docs), then select your account name from the **Select an account** dropdown.
2.  Go to the API Explorer's **Application host** page at [api.newrelic.com/docs](https://api.newrelic.com/docs/#/Applications/get_applications__application_id__hosts_json).

**Host ID and summary data using the REST API Explorer**

To use the API Explorer to return a list of every `$HOST_ID` for a particular application, you will need the [`$APP_ID`](https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/finding-product-id).

1.  Go to the [API Explorer](https://api.newrelic.com/docs/#/Applications/get_applications__application_id__hosts_json), then select your account name from the **Select an account** dropdown.
2.  Enter the specific [`$APP_ID`](https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/finding-product-id) in the following command:

    ```sh
    curl -X GET "https://api.newrelic.com/v2/applications/$APP_ID/hosts.json" \
         -H "Api-Key:$API_KEY" -i
    ```

    If you have an [EU region account](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/getting-started/introduction-eu-region-data-center), the endpoint begins with `https://api.eu.newrelic.com`.
3.  Select **Send Request**.
4.  Browse the **Response** to locate the `HOST_ID` for each host.

**HOST_ID output**

The output will appear similar to this:

````json
{
  "application_hosts": [
    {
      "id": 34966,             <---<<< HOST_ID
      "application_name": "Combined Production",
      "host": "prod-app-10.com",
      "language": "ruby",
      "health_status": "green",
      "application_summary": {
        . . .
      },
      "links": {
        "application": 1234,   <---<<< APP_ID
        "application_instances": [
          13512                <---<<< INSTANCE_ID
        ],
      }
    },
    {
      "id": 9999999,           <---<<< HOST_ID
      "application_name": "Combined Production",
      "host": "prod-app-11.com",
      "language": "ruby",
      "health_status": "green",
      "application_summary": {
        ". . .
      },
      "links": {
        "application": 1234,   <---<<< APP_ID
        "application_instances": [
          186288               <---<<< INSTANCE_ID
        ],
      }
    },
. . .
```

````

## List instance IDs [#locating_instance_id]

The instance ID meaning depends on the New Relic language agent being used. You can list this ID from the REST API.

| Agent   | Instance ID represents                                    |
| ------- | --------------------------------------------------------- |
| Go      | The Go program on the host reporting to the app name      |
| Java    | A Java Virtual Machine (JVM)                              |
| .NET    | For the agent for .NET Framework, this is the `AppDomain` |
| Node.js | A worker process                                          |
| PHP     | The daemon agent                                          |
| Ruby    | An individual Ruby worker process                         |
| Python  | The master and worker processes                           |

You can retrieve summary metrics for the instance as well as specific metric timeslice values using the `INSTANCE_ID`. For details about available metrics, use the [REST API Explorer Application Instance](https://api.newrelic.com/docs/#/Applications/get_applications__application_id__instances__instance_id__metrics_json) page.

**Instance ID and summary data using the REST API Explorer**

To use the API Explorer to return a list of every `$INSTANCE_ID` for a particular application, you will need the [`$APP_ID`](https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/finding-product-id).

1.  Go to the [API Explorer](https://api.newrelic.com/docs), then select your account name from the **Select an account** dropdown.
2.  Enter the specific [`$APP_ID`](https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/finding-product-id) in the following command:

    ```sh
    curl -X GET "https://api.newrelic.com/v2/applications/$APP_ID/hosts.json" \
         -H "Api-Key:$API_KEY" -i
    ```

    If you have an [EU region account](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/getting-started/introduction-eu-region-data-center), the endpoint begins with `https://api.eu.newrelic.com`.
3.  Select **Send Request**.
4.  Browse the **Response** to locate the `$INSTANCE_ID` for each instance.

**INSTANCE_ID output**

The `INSTANCE_ID` output will appear similar to this:

````json
{
  "application_instances": [
    {
      "id": 35120,                  <---<<< INSTANCE_ID
      "application_name": "Combined Production",
      "host": "prod-app-10.com",
      "language": "ruby",
      "health_status": "green",
      "application_summary": {
        . . .
      },
      "links": {
        "application": 1441,        <---<<< APP_ID
        "application_host": 34966,  <---<<< HOST_ID
      }
    },
    {
      "id": 186288,                 <---<<< INSTANCE_ID
      "application_name": "Combined Production",
      "host": "prod-app-11.com",
      "language": "ruby",
      "health_status": "green",
      "application_summary": {
        . . .
      },
      "links": {
        "application": 1441,         <---<<< APP_ID
        "application_host": 186283,  <---<<< HOST_ID
      }
    },
. . .
```

````

## REST API application list example [#app-list-example]

The following example shows how to locate all the ID information for an application by using the `APP_ID`. If you have an [EU account](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/getting-started/introduction-eu-region-data-center), the endpoint begins with `https://api.eu.newrelic.com`.

```sh
curl -X GET 'https://api.newrelic.com/v2/applications.json' \
     -H "Api-Key:$API_KEY" -i \
     -d 'filter[ids]=1441'    <----<<<< APP_ID
```

The resulting example output is running on five servers. One server is hosting two virtual hosts for a total of six hosts. The output includes a `links` section listing the `application_instances` and `application_hosts` for the application.

```json
{
  "applications": [
    {
      "id": 1441,                   <----<<<< APP_ID
      "name": "RPM Combined Production",
      "language": "ruby",
      "health_status": "green",
      "reporting": true,
      "last_reported_at": "2015-11-10T23:19:47+00:00",
      "application_summary": {
        . . .
      },
      "end_user_summary": {
        . . .
      },
      "settings": {
        . . .
      },
      "links": {
        "application_instances": [  <---<<<< INSTANCE_ID list
          21790,
          24810,
          27948,
          35120,
          35121,
          35122,
          186288,
          247253,
          247254,
          247255,
          247256
        ],
        "application_hosts": [      <---<<<< HOST_ID list
          21788,
          24808,
          34966,
          186283,
          247245,
          286551
        ]
      }
    }
  ],
. . .
```
