---
title: "fetch(withRecordID:completionHandler:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/fetch(withrecordid:completionhandler:)"
---

# fetch(withRecordID:completionHandler:)

Fetches a specific record.

## Declaration

```swift
func fetch(withRecordID recordID: CKRecord.ID, completionHandler: @escaping @Sendable (CKRecord?, (any Error)?) -> Void)
```

```swift
func fetch(withRecordID recordID: CKRecord.ID) async throws -> CKRecord
```

## Parameters

- `recordID`: The identifier of the record to fetch.
- `completionHandler`: The closure to execute with the fetch results.

## Discussion

Discussion The completion handler takes the following parameters: The requested record, or nil if CloudKit can’t provide that record. An error if a problem occurs, or nil if the fetch completes successfully. For information on a more convenient way to fetch specific records, see records(for:desiredKeys:).

## See Also

### Fetching Records

- [records(for:desiredKeys:)](cloudkit/ckdatabase/records(for:desiredkeys:).md)
- [fetch(withRecordIDs:desiredKeys:completionHandler:)](cloudkit/ckdatabase/fetch(withrecordids:desiredkeys:completionhandler:).md)
