Closed crstauf closed 7 months ago
Hi,
The url you posted in your example is invalid (as per the 404), it's missing /info
or picture dimensions at the end.
If you use the endpoint with /info
, it will return the information as JSON:
curl -L -X GET https://picsum.photos/seed/picsum/info
{"id":"866","author":"Samuel Zeller","width":4704,"height":3136,"url":"https://unsplash.com/photos/9RqA6tnT0gA","download_url":"https://picsum.photos/id/866/4704/3136"}
If you use the endpoint with dimensions correctly, it will return a redirect with the image. If you follow this redirect, you will find that it indeed contains the Picsum-ID
header:
▶ curl -L -I -X GET https://picsum.photos/seed/picsum/200/200
HTTP/2 302
date: Tue, 30 Jan 2024 20:39:11 GMT
content-length: 0
location: https://fastly.picsum.photos/id/866/200/200.jpg?hmac=i0ngmQOk9dRZEzhEosP31m_vQnKBQ9C19TBP1CGoIUA
cache-control: private, no-cache, no-store, must-revalidate
vary: Origin
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=xtrVWvfZJuKnqBMMx%2F3o97bytzoLduvaFIG%2FJiJf61tBDbzvi6MVUXhXcPm47bDaFS%2BpB7nrX3f%2FBbQ%2F6TQHTIThEj1%2FrTXhdNh%2FT96MsXfQBrITFYTxywI%2BYI8t5G0%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
strict-transport-security: max-age=15552000
x-content-type-options: nosniff
server: cloudflare
cf-ray: 84dc85d70f872d69-ARN
alt-svc: h3=":443"; ma=86400
HTTP/2 200
content-type: image/jpeg
cache-control: public, max-age=2592000, stale-while-revalidate=60, stale-if-error=43200, immutable
content-disposition: inline; filename="866-200x200.jpg"
picsum-id: 866
timing-allow-origin: *
accept-ranges: bytes
date: Tue, 30 Jan 2024 20:39:11 GMT
via: 1.1 varnish
age: 562462
x-served-by: cache-bma1667-BMA
x-cache: HIT
x-cache-hits: 1
x-timer: S1706647151.354844,VS0,VE1
vary: Origin
content-length: 5115
Ahhh, my (silly) mistake with the 404. Thanks for your help.
The https://picsum.photos/#image-details section indicates that "you can find out the ID of an image by looking at the
Picsum-ID
header", but there is no header with said key.