Widget to show random image from Google Photos?

Is there a way to show a random image from Google photos in a Scriptable widget?

Can’t think of a way unless google photos offers an API. So if you’re comfortable with coding it may be possible, otherwise probably very difficult.