Skip to content

fix: source.unsplash.com/random was deprecated in 2024 (now 503s)#15

Open
kiluazen wants to merge 1 commit into
gravitano:mainfrom
kiluazen:fix/unsplash-random-deprecated-2026-04-22
Open

fix: source.unsplash.com/random was deprecated in 2024 (now 503s)#15
kiluazen wants to merge 1 commit into
gravitano:mainfrom
kiluazen:fix/unsplash-random-deprecated-2026-04-22

Conversation

@kiluazen
Copy link
Copy Markdown

layers/blog/pages/blog/posts/[id].vue references the deprecated source.unsplash.com/random endpoint, which Unsplash retired in mid-2024 and which now returns HTTP 503 instead of an image.


Why this is needed

source.unsplash.com/random was deprecated by Unsplash in mid-2024 and the endpoint now returns 503 errors. Browser screenshots typically render a broken image icon instead of the intended placeholder.

You can verify in any browser:

curl -I https://source.unsplash.com/random/800x600?office
# HTTP/1.1 503 Service Unavailable

What this PR changes

Replaces the deprecated tag-keyed random image with a seeded picsum.photos URL so the blog post hero renders again.

Replacement details

The seed is built from the post's tags so each post gets a stable image, and a 1200×600 size matches a typical blog hero. The tag-as-keyword behaviour is lost — see the trade-off note in the linked tteg README if you want a topic-matched image instead of a stable random one.

Background

I'm tracking deprecated image-CDN URLs across public repos as part of tteg, a tiny CLI/HTTP API I built to make it easy to drop real Unsplash photos into projects without registering an Unsplash app or managing API keys. tteg isn't a dependency of this PR — the fix above is dependency-free. But if you ever want to swap the static replacement for something topic-aware, the no-key HTTP API is at https://tteg-api-53227342417.asia-south1.run.app/search?q=<query>&n=1 (CORS-on, no auth).

A 16k-files-across-885-repos summary of the deprecation is at kiluazen/tteg/RESEARCH.md.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

@kiluazen is attempting to deploy a commit to the Warsono's projects Team on Vercel.

A member of the Team first needs to authorize it.

@kiluazen
Copy link
Copy Markdown
Author

Quick post-PR addendum (purely informational): I built a public scanner that highlights this same broken-URL pattern in any landing page — useful for verifying the fix lands cleanly, or for finding other places source.unsplash.com/random slipped in.

Pre-loaded scan example: https://tteg.kushalsm.com/scan?url=

Source: https://github.com/kiluazen/tteg-landing/blob/main/scan.html (Cloudflare Pages Function does the fetch so it works for any HTTPS site). Not a dependency of this PR — just a tool you may find handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant