<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ShazamKit",
  "identifier" : "/documentation/ShazamKit/SHLibrary/addItems(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ShazamKit"
    ],
    "preciseIdentifier" : "s:9ShazamKit9SHLibraryC8addItemsyySaySo11SHMediaItemCGYaKF"
  },
  "title" : "addItems(_:)"
}
-->

# addItems(_:)

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

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

## Parameters

`items`

An array containing the [`SHMediaItem`](/documentation/ShazamKit/SHMediaItem) objects to add to the library.

## Discussion

The library only accepts media items with a [`shazamID`](/documentation/ShazamKit/SHMediaItem/shazamID). The `shazamID` must be a numeric only string.

This throws [`SHError.Code.mediaLibrarySyncFailed`](/documentation/ShazamKit/SHError/Code/mediaLibrarySyncFailed) if the system can’t add at least one [`SHMediaItem`](/documentation/ShazamKit/SHMediaItem) or if an error occurred during the addition. In that case, the system doesn’t add any items to the library.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)