---
title: "contentItem(forIdentifier:completionHandler:)"
framework: mediaplayer
role: symbol
role_heading: Instance Method
path: "mediaplayer/mpplayablecontentdatasource/contentitem(foridentifier:completionhandler:)"
---

# contentItem(forIdentifier:completionHandler:)

Retrieves the content item associated with the provided identifier.

## Declaration

```swift
optional func contentItem(forIdentifier identifier: String, completionHandler: @escaping @Sendable (MPContentItem?, (any Error)?) -> Void)
```

```swift
optional func contentItem(forIdentifier identifier: String) async throws -> MPContentItem
```

## Parameters

- `identifier`: The String that identifies a content item.
- `completionHandler`: A block that is called after the content item has been loaded.

## Discussion

Discussion Client apps should always call the completion handler after loading has finished.

## See Also

### Retrieving a media item

- [contentItem(at:)](mediaplayer/mpplayablecontentdatasource/contentitem(at:).md)
