I’m trying to build an image gallery for my website and I want to store all the photos in a Google Drive folder that’s shared publicly. The problem is I need to get a list of all the files in that folder programmatically but I don’t want to go through the whole OAuth process or require users to authenticate. Is there any way to fetch the file listing from a public Google Drive folder without needing any authorization tokens or API keys? I’ve seen some public folders before where you can browse the contents directly, so I’m wondering if there’s a simple method to extract just the filenames and maybe file URLs from such folders. This would save me from having to manually update my gallery every time I add new images to the Drive folder.
google stopped allowing direct access to public drive folders, it’s super restricted now. try using google apps script to fetch the folder contents and make a json endpoint from it. once it’s set up, it’ll update automatically without needing to do much.
Had this exact problem last year with my portfolio site. Google killed the ability to query public folders directly back in 2017 - you need API auth now. Here’s what worked for me: I wrote a simple PHP script that runs on my server, grabs the file list using Drive API with a service account, then dumps everything into a JSON file my frontend reads. You’ll need to set up a service account in Google Cloud Console and share your Drive folder with its email. Not completely auth-free, but it skips OAuth for users and keeps your gallery synced automatically.
Getting a list of files from a public Google Drive folder without authentication can be tricky since Google has tightened access controls. Previously, there were easier methods using folder IDs in URLs, but those have largely been restricted now. What I did was set up a script on my server with a service account, which allows read-only access to the needed folder without the OAuth hassle. While not completely automated, you could also maintain an updated static JSON file for your image gallery or consider alternatives like GitHub Pages or a headless CMS to host your images more straightforwardly.