Hacked together a Google Photos like Memories notification service

I love Immich and am truly grateful to the development team for all the awesome work they are doing. One feature that is missing from Immich is getting notified on mobile for memories. It was always great to see memories from the past when I was on Google Photos.

So I hacked together a Python script that sends similar notifications. Tested on Android only. I used Gotify as a notification server but I'm sure you can use any other as well. The script can be set up as a cron job to execute every day. Clicking on the notification will take you to Immich app where you can see any all the memories generated on that day. The script has been tested to work fine on Immich v1.137.3. Let me know you thoughts, cheers!

Here is the script -

#!/usr/bin/env python3

import requests

import json

from datetime import datetime, timedelta, timezone

# Configuration

IMMICH_URL = ""

IMMICH_API_KEY = ""

GOTIFY_URL = ""

GOTIFY_TOKEN = ""

def check_memories():

headers = {"x-api-key": IMMICH_API_KEY}

try:

# Get all memories

response = requests.get(f"{IMMICH_URL}/memories", headers=headers)

response.raise_for_status()

memories = response.json()

# Get current date in UTC

now = datetime.now(timezone.utc)

today = now.replace(hour=0, minute=0, second=0, microsecond=0)

tomorrow = today + timedelta(days=1)

# Process memories

active_memories = []

for memory in memories:

try:

# Parse showAt and hideAt dates

show_at = datetime.fromisoformat(memory["showAt"].replace("Z", "+00:00"))

hide_at = datetime.fromisoformat(memory["hideAt"].replace("Z", "+00:00"))

# Check if memory is active today

if show_at <= now < hide_at:

# Create title based on memory type

if memory["type"] == "on_this_day":

year = memory["data"]["year"]

title = f"On this day in {year}"

else:

title = f"Memory: {memory['type']}"

# Get asset count

asset_count = len(memory["assets"])

active_memories.append({

"title": title,

"year": memory["data"]["year"],

"asset_count": asset_count,

"memory": memory

})

except Exception as e:

print(f"Error processing memory: {str(e)}")

continue

if active_memories:

message = f"📸 New Immich Memories:\n"

for memory in active_memories[:5]:

message += f"• {memory['title']} ({memory['asset_count']} photos)\n"

if len(active_memories) > 5:

message += f"...and {len(active_memories) - 5} more"

# Send notification with deep link

send_notification(message)

print(f"Sent notification for {len(active_memories)} memories")

else:

print("No active memories found for today")

except Exception as e:

print(f"Error: {str(e)}")

send_notification(f"❌ Immich memory check failed: {str(e)}")

def send_notification(message):

url = f"{GOTIFY_URL}/message"

headers = {"X-Gotify-Key": GOTIFY_TOKEN}

# Create deep link to Immich app memories

deep_link = "immich://memories"

data = {

"message": message,

"title": "Immich Memories",

"priority": 5,

"extras": {

"client::display": {

"contentType": "text/markdown"

},

"client::notification": {

"click": {

"url": deep_link

}

}

}

}

try:

response = requests.post(url, json=data, headers=headers)

response.raise_for_status()

print("Notification sent successfully")

except Exception as e:

print(f"Failed to send notification: {str(e)}")

if __name__ == "__main__":

check_memories()

Posted Sep 4, 2025, 11:27 PM UTC

311

Comments aren't archived yet

This post had 1 comment on Reddit. Comments for this period haven't been loaded into the archive yet.