You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于通过Google Photos API获取用户回忆(Memories)的技术问询

如何通过Google Photos API获取用户回忆(Memories)?

Hey there,

I totally get where you're coming from—trying to pull up those nostalgic Memories via the Google Photos API can feel like hitting a wall at first, since it's not explicitly called out in the official docs. Let me break down what I know about this scenario:

First, the straight-up truth: The Google Photos API doesn't currently have a dedicated endpoint or method specifically built to fetch "Memories" directly. Those curated, personalized collections are part of Google's internal personalization logic, which hasn't been exposed publicly through the API yet.

But don't worry—there are workarounds that can get you pretty close to replicating the Memories functionality programmatically:

  • Mimic Memories with date-based search filters: Memories typically resurface content from the same date in previous years, or media that's been untouched for a long time. You can use the API's search endpoint with a dateFilter to target these timeframes. For example, to pull media from exactly 3 years ago, your request body might look like this:

    {
      "pageSize": 15,
      "filters": {
        "dateFilter": {
          "dates": [
            {
              "year": 2020,
              "month": 10,
              "day": 12
            }
          ]
        }
      }
    }
    

    You'd just dynamically calculate the target date (e.g., current date minus N years) to match the kind of content Memories surfaces.

  • Combine filters to narrow down relevant content: While there's no "MEMORIES" flag in the API's featureFilter, you can pair date filters with other criteria to refine results. For example, you might filter for media types (photos vs. videos) or exclude items marked as favorites (since Memories often includes less frequently interacted content).

A quick heads-up: Google might expand the API to include dedicated Memories support down the line, so it's worth checking the official docs periodically for new endpoints or parameters. Also, make sure your OAuth setup includes the https://www.googleapis.com/auth/photoslibrary.readonly scope—you'll need that to access a user's media items.

Hope these tips help you build a solution that fits your project needs!

备注:内容来源于stack exchange,提问作者Ben Rosenbaum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 08:59:32