---
title: "fetchHistory(during:completionHandler:)"
framework: Screen Time
role: symbol
role_heading: Instance Method
platforms: [iOS 18.4+, iPadOS 18.4+, Mac Catalyst 18.4+, macOS 15.4+]
path: "screentime/stwebhistory/fetchhistory(during:completionhandler:)"
---

# fetchHistory(during:completionHandler:)

Fetches web history that occurred during the date interval you specify.

## Declaration

```swift
func fetchHistory(during interval: DateInterval, completionHandler: @escaping @Sendable (Set<URL>?, (any Error)?) -> Void)
```

```swift
func fetchHistory(during interval: DateInterval) async throws -> Set<URL>
```

## Parameters

- `interval`: The date interval of web history you want to fetch.
