ARTICLE AD BOX
I am using the YouTube Data API v3's Videos.update endpoint to update a video. My intention is to update the video title while leaving all other video information untouched. The documentation notes:
If you are submitting an update request, and your request does not specify a value for a property that already has a value, the property's existing value will be deleted.
I ran a video update as a test, only specifying values for the required properties of id, snippet.title, and snippet.categoryId. Afterwards, I found that only some of the unspecified fields the video got deleted.
For example,
snippet.description and snippet.tags got reset snippet.defaultAudioanguage, status.privacyStatus, and recordingDetails.recordingDate were preserved.Why are only some video properties having their values reset when I don't specify them in an update request? Which properties get reset and which keep their values?
Code:
import google_auth_oauthlib.flow import googleapiclient.discovery import pprint SCOPES = ["https://www.googleapis.com/auth/youtube"] CLIENT_SECRETS_FILE = "client_secrets.json" def setup_youtube_auth(): """Sets up YouTube authentication via OAuth. Will open a browser window for user to login.""" flow = google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file(CLIENT_SECRETS_FILE, SCOPES) credentials = flow.run_local_server(port=0) youtube = googleapiclient.discovery.build("youtube", "v3", credentials=credentials) return youtube def get_video_info(youtube, video_id): video_response = youtube.videos().list( part="snippet,status,recordingDetails", id=video_id, ).execute() return video_response["items"][0] def main(): youtube = setup_youtube_auth() video_info = get_video_info(youtube, ["QSC_ahDwuBs"]) # Update video data video_update_response = youtube.videos().update( part="snippet,status,recordingDetails", body={ "id": video_info["id"], "snippet": { "title": "test title", "categoryId": video_info["snippet"]["categoryId"], }, } ).execute() print("Original video data:") pprint.pp(video_info) print("\nNew video data:") pprint.pp(video_update_response) if __name__ == "__main__": main()Output (responses from YouTube API):
Original video data: {'kind': 'youtube#video', 'etag': 'EGsN9P9guRxKQKq6rlIABBeolUk', 'id': 'QSC_ahDwuBs', 'snippet': {'publishedAt': '2025-12-04T04:14:15Z', 'channelId': 'UCBsCBmK9rCmn3Pf8Gpa-jOg', 'title': '2025 12 03 20 14 27', 'description': 'Test description', 'thumbnails': {'default': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/default.jpg?sqp=CNjg1coG&rs=AOn4CLDo7hd7ulDKPxYFYVLaaAvwBs2QBA', 'width': 120, 'height': 90}, 'medium': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/mqdefault.jpg?sqp=CNjg1coG&rs=AOn4CLA4Gh4B9OcbJIYH-sk5dKZKJIXq7w', 'width': 320, 'height': 180}, 'high': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/hqdefault.jpg?sqp=CNjg1coG&rs=AOn4CLB3b3fX0UNnkRUrsOgIAp84JoIfdA', 'width': 480, 'height': 360}, 'standard': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/sddefault.jpg?sqp=CNjg1coG&rs=AOn4CLDj-9XMuiV-fpLdWTkHBZJ0iYNehQ', 'width': 640, 'height': 480}, 'maxres': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/maxresdefault.jpg?sqp=CNjg1coG&rs=AOn4CLD4WPsZzkSV0d4WaOclFrxmBoPY3Q', 'width': 1280, 'height': 720}}, 'channelTitle': "Stevoisiak's Junkyard", 'tags': ['Mario Builder 64'], 'categoryId': '20', 'liveBroadcastContent': 'none', 'localized': {'title': '2025 12 03 20 14 27', 'description': 'Test description'}, 'defaultAudioLanguage': 'en'}, 'status': {'uploadStatus': 'processed', 'privacyStatus': 'private', 'license': 'youtube', 'embeddable': False, 'publicStatsViewable': True, 'madeForKids': True, 'selfDeclaredMadeForKids': True}, 'recordingDetails': {'recordingDate': '2025-12-03T00:00:00Z'}} New video data: {'kind': 'youtube#video', 'etag': 'nGr4hCyKhOM4X5v0dTQs_Q3DgWo', 'id': 'QSC_ahDwuBs', 'snippet': {'publishedAt': '2025-12-04T04:14:15Z', 'channelId': 'UCBsCBmK9rCmn3Pf8Gpa-jOg', 'title': 'test title', 'description': '', 'thumbnails': {'default': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/default.jpg?sqp=CNjg1coG&rs=AOn4CLDo7hd7ulDKPxYFYVLaaAvwBs2QBA', 'width': 120, 'height': 90}, 'medium': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/mqdefault.jpg?sqp=CNjg1coG&rs=AOn4CLA4Gh4B9OcbJIYH-sk5dKZKJIXq7w', 'width': 320, 'height': 180}, 'high': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/hqdefault.jpg?sqp=CNjg1coG&rs=AOn4CLB3b3fX0UNnkRUrsOgIAp84JoIfdA', 'width': 480, 'height': 360}, 'standard': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/sddefault.jpg?sqp=CNjg1coG&rs=AOn4CLDj-9XMuiV-fpLdWTkHBZJ0iYNehQ', 'width': 640, 'height': 480}, 'maxres': {'url': 'https://i9.ytimg.com/vi/QSC_ahDwuBs/maxresdefault.jpg?sqp=CNjg1coG&rs=AOn4CLD4WPsZzkSV0d4WaOclFrxmBoPY3Q', 'width': 1280, 'height': 720}}, 'channelTitle': "Stevoisiak's Junkyard", 'categoryId': '20', 'liveBroadcastContent': 'none', 'localized': {'title': 'test title', 'description': ''}, 'defaultAudioLanguage': 'en-US'}, 'status': {'uploadStatus': 'processed', 'privacyStatus': 'private', 'license': 'youtube', 'embeddable': False, 'publicStatsViewable': True, 'selfDeclaredMadeForKids': True}, 'recordingDetails': {'recordingDate': '2025-12-03T00:00:00Z'}}