Refresh Metadata for a Library

All media items in Plex have metadata that is displayed when viewing the item in Plex. This information can be found either locally on the Plex server or downloaded from the Internet.

You should refresh the metadata for a library if one of the following has occurred:

  • The library metadata agent has changed.
  • Added local media assets, such as artwork, theme music, subtitle files, etc.
  • Wanted to update the posters, summary or other information for the media
  • Media items are missing posters or information.

This command will refresh the metadata for all items in a library.

URL

GET http://{ip_address}:32400/library/sections/{id}/refresh?force={force}&X-Plex-Token={plex_token}

Parameters

NameDescription
ip_addressThe IP address of the Plex Media server.
plex_tokenThe Plex token.
idThe key associated with the library. This key can be found by calling the Libraries API command.
forceA flag indicating if the API command will refresh the metdata for all items regardless of any changes. 1 for forcing the refresh, otherwise 0

Return Status

HTTP CodeDescription
200Success - The request was successful.
401Unauthorized - The Plex token provided was not valid.

Response

No response is returned. You will be able to see the refresh metadata API command run from the Plex console.

Remarks

When the force parameter is set to 1, all metadata for all items in library will be refreshed, regardless of whether the metadata needed to be refreshed. By setting the force parameter to 0, only items with missing metadata will be refreshed.

Setting the force parameter to 1 can cause more processing by the Plex server, and take much longer to run. When running the Refresh All Metadata from the Plex Web app, the force value is set to 1.

Examples

curl -X GET http://{ip_address}:32400/library/sections/{id}/refresh?force={force}&X-Plex-Token={plex_token}
import requests
plex_url = http://{ip_address}:32400/library/sections/{id}/refresh?force={force}&X-Plex-Token={plex_token}
response = requests.get(plex_url)
print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/library/sections/{id}/refresh?force={force}&X-Plex-Token={plex_token}' -Method 'GET'
Write-Output $response
Subscribe
Display