---
title: Get an Archive Search
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Logs Archive Searches
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Get an Archive Search{% #get-an-archive-search %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                       |
| ----------------- | ---------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/logs/archive_searches/{archive_search_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/logs/archive_searches/{archive_search_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/logs/archive_searches/{archive_search_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/logs/archive_searches/{archive_search_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/logs/archive_searches/{archive_search_id}  |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/logs/archive_searches/{archive_search_id} |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/logs/archive_searches/{archive_search_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/logs/archive_searches/{archive_search_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/logs/archive_searches/{archive_search_id} |

### Overview

Get a single Archive Search, including its status and the amount of archive data scanned when the search finishes. This endpoint requires the `logs_read_data` permission.

### Arguments

#### Path Parameters

| Name                                | Type   | Description                              |
| ----------------------------------- | ------ | ---------------------------------------- |
| archive_search_id [*required*] | string | Unique identifier of the Archive Search. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a single Archive Search.

| Parent field | Field                                   | Type      | Description                                                                                                             |
| ------------ | --------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]                  | object    | Archive Search object.                                                                                                  |
| data         | attributes [*required*]            | object    | Attributes of an Archive Search.                                                                                        |
| attributes   | archive_id [*required*]            | string    | ID of the archive being searched.                                                                                       |
| attributes   | bytes_scanned [*required*]         | int64     | Number of bytes read from the archive at the end of the search.                                                         |
| attributes   | completed_at                            | date-time | Time the Archive Search finished, as an ISO 8601 timestamp. Absent while the search is still running.                   |
| attributes   | created_at [*required*]            | date-time | Time the Archive Search was created, as an ISO 8601 timestamp.                                                          |
| attributes   | description                             | string    | Free-text description of the Archive Search.                                                                            |
| attributes   | events_scanned [*required*]        | int64     | Number of events read from the archive at the end of the search.                                                        |
| attributes   | expected_duration                       | int64     | Estimated time left before the Archive Search completes, in seconds.                                                    |
| attributes   | from [*required*]                  | date-time | Start of the searched time range, as an ISO 8601 timestamp.                                                             |
| attributes   | name [*required*]                  | string    | Name of the Archive Search.                                                                                             |
| attributes   | query [*required*]                 | string    | Log search query used to filter the archived logs.                                                                      |
| attributes   | rehydration                             | object    | Rehydration settings of the Archive Search. Absent when the search only scans the archive without indexing the results. |
| rehydration  | max_rehydrated_events [*required*] | int64     | Maximum number of events to rehydrate.                                                                                  |
| rehydration  | retention_days [*required*]        | int64     | Number of days the rehydrated logs are retained for.                                                                    |
| rehydration  | tier [*required*]                  | enum      | Storage tier the matched logs are rehydrated into. Allowed enum values: `standard,flex`                                 |
| attributes   | status [*required*]                | enum      | Current state of an Archive Search. Allowed enum values: `RUNNING,COMPLETED,FAILED,CANCELLED,QUOTA_REACHED,EXPIRED`     |
| attributes   | to [*required*]                    | date-time | End of the searched time range, as an ISO 8601 timestamp.                                                               |
| data         | id [*required*]                    | string    | Unique identifier of the Archive Search.                                                                                |
| data         | type [*required*]                  | enum      | Archive Search resource type. Allowed enum values: `archive_search`                                                     |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archive_id": "mhmyYmyLTOaFYKvhNadu1w",
      "bytes_scanned": 402764439,
      "completed_at": "2026-01-02T12:30:00Z",
      "created_at": "2026-01-02T12:00:00Z",
      "description": "Investigating the checkout latency spike.",
      "events_scanned": 1500,
      "expected_duration": 120,
      "from": "2026-01-01T00:00:00Z",
      "name": "checkout-latency-investigation",
      "query": "service:checkout status:error",
      "rehydration": {
        "max_rehydrated_events": 1000000,
        "retention_days": 15,
        "tier": "standard"
      },
      "status": "RUNNING",
      "to": "2026-01-02T00:00:00Z"
    },
    "id": "nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq",
    "type": "archive_search"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export archive_search_id="nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq" \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/logs/archive_searches/${archive_search_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" 
                
##### 

```python
"""
Get an Archive Search returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_archive_searches_api import LogsArchiveSearchesApi

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["get_archive_search"] = True
with ApiClient(configuration) as api_client:
    api_instance = LogsArchiveSearchesApi(api_client)
    response = api_instance.get_archive_search(
        archive_search_id="archive_search_id",
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
##### 

```ruby
# Get an Archive Search returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
  config.unstable_operations["v2.get_archive_search".to_sym] = true
end
api_instance = DatadogAPIClient::V2::LogsArchiveSearchesAPI.new
p api_instance.get_archive_search("archive_search_id")
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
##### 

```go
// Get an Archive Search returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetArchiveSearch", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewLogsArchiveSearchesApi(apiClient)
	resp, r, err := api.GetArchiveSearch(ctx, "archive_search_id")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LogsArchiveSearchesApi.GetArchiveSearch`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `LogsArchiveSearchesApi.GetArchiveSearch`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
##### 

```java
// Get an Archive Search returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchiveSearchesApi;
import com.datadog.api.client.v2.model.ArchiveSearchResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    defaultClient.setUnstableOperationEnabled("v2.getArchiveSearch", true);
    LogsArchiveSearchesApi apiInstance = new LogsArchiveSearchesApi(defaultClient);

    try {
      ArchiveSearchResponse result =
          apiInstance.getArchiveSearch("nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchiveSearchesApi#getArchiveSearch");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
##### 

```rust
// Get an Archive Search returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_logs_archive_searches::LogsArchiveSearchesAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.get_archive_search", true);
    let api = LogsArchiveSearchesAPI::with_config(configuration);
    let resp = api
        .get_archive_search("archive_search_id".to_string())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
{% /tab %}
