Skip to content

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

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

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

Conversation

@kiluazen
Copy link
Copy Markdown

src/fake.ts 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 HTTP 503 instead of an image. Browsers render a broken-image icon in place of the intended visual.

Verify in any shell:

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

What this PR changes

Updates the getRandomImage faker source URL from the deprecated source.unsplash.com/random/ to picsum.photos/, which serves a random image at the same /<W>/<H> path shape.

Replacement details

Picsum.photos is the canonical drop-in for source.unsplash.com/random since the deprecation; it accepts the same path shape (/<W>/<H>), needs no auth, and reliably returns a 200 image.

Background

I'm tracking the deprecated source.unsplash.com/random endpoint across public repos as part of tteg, a tiny CLI/HTTP API I built so projects can drop in real Unsplash photos without registering an Unsplash app or managing API keys. tteg isn't introduced as a dependency by this PR — the diff is dependency-free picsum.photos. But if you want topic-matched real photos as a follow-up, the no-key HTTP API is at https://tteg-api-53227342417.asia-south1.run.app/search?q=<query>&n=1 (CORS-on, no auth).

Research note covering ~16,500 files across ~885 unique repos that still hotlink the deprecated endpoint: https://github.com/kiluazen/tteg/blob/research-note-autark/RESEARCH.md.

@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