Another simple experiment (which makes use of my URL Metadata API Endpoint experiment) is similar to how Gravatar works:
With this experiement, you can make a request to an endpoint, passing in a URL. The API will crawl that URL, and if an open graph image is found, simply redirect you to the image URL. If none is found, then the client will get redirected to a default image URL.
Below are some URLs for to to see how it works:
- https://og.imnosy.com/?u=getstencil.com
- https://og.imnosy.com/?u=https%3A%2F%2Fbioforce.org%2F
- https://og.imnosy.com/?u=ferd.ca%2Fdr-dj.html
- https://og.imnosy.com/?u=https%3A%2F%2Ficonic.app
- https://og.imnosy.com/?u=https%3A%2F%2F3dicons.co%2F
- https://og.imnosy.com/?u=https%3A%2F%2Ficonoir.com%2F
Note: The host og.imnosy.com
is
simply a 301
redirect to the endpoint
https://aws-api.416.io/utils/v1/url/redirect/og
(albeit, with a CDN in-between to speed things up).
At the moment, the fallback image URL for a URL that doesn't have an open graph image is this cute graphic.
If you want to pass in your own fallback image URL (for example, the image URL https://i.imgur.com/ncMFymv.png), use an endpoint address like the following:
Note: Both the u
and f
params should be URL encoded.