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

# fetch(withSubscriptionID:completionHandler:)

Fetches a specific subscription and delivers it to a completion handler.

## Declaration

```swift
@preconcurrency func fetch(withSubscriptionID subscriptionID: CKSubscription.ID, completionHandler: @escaping @Sendable (CKSubscription?, (any Error)?) -> Void)
```

## Parameters

- `subscriptionID`: The identifier of the subscription to fetch.
- `completionHandler`: The closure to execute with the fetch results.

## Discussion

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

## See Also

### Fetching Subscriptions

- [subscriptions(for:)](cloudkit/ckdatabase/subscriptions(for:).md)
- [fetch(withSubscriptionIDs:completionHandler:)](cloudkit/ckdatabase/fetch(withsubscriptionids:completionhandler:).md)
- [subscription(for:)](cloudkit/ckdatabase/subscription(for:).md)
- [fetchAllSubscriptions(completionHandler:)](cloudkit/ckdatabase/fetchallsubscriptions(completionhandler:).md)
