---
title: "addItems(_:)"
framework: ShazamKit
role: symbol
role_heading: Instance Method
platforms: [iOS 17.0+, iPadOS 17.0+, Mac Catalyst 17.0+, macOS 14.0+, tvOS 17.0+, visionOS 1.0+, watchOS 10.0+]
path: "shazamkit/shlibrary/additems(_:)"
---

# addItems(_:)

Adds an array of media items to the user’s Shazam library.

## Declaration

```swift
final func addItems(_ items: [SHMediaItem]) async throws
```

## Parameters

- `items`: An array containing the doc://com.apple.shazamkit/documentation/ShazamKit/SHMediaItem objects to add to the library.

## Discussion

Discussion The library only accepts media items with a shazamID. The shazamID must be a numeric only string. This throws SHError.Code.mediaLibrarySyncFailed if the system can’t add at least one SHMediaItem or if an error occurred during the addition. In that case, the system doesn’t add any items to the library.

## See Also

### Managing the items in the library

- [default](shazamkit/shlibrary/default.md)
- [removeItems(_:)](shazamkit/shlibrary/removeitems(_:).md)
- [items](shazamkit/shlibrary/items.md)
