Sleywill left a comment (openstreetmap/openstreetmap-website#2965)
For the map tile / area screenshot part of OG previews,
[SnapAPI](https://snapapi.pics) might be useful — it can capture a full-page
screenshot of any URL and return it as an image directly. Could work for
generating the static OG image from the map view URL without maintaining your
own headless browser infrastructure.
```ruby
# Example: generate OG image for /relation/12345
response = HTTP.post('https://api.snapapi.pics/v1/screenshot',
json: { url: 'https://www.openstreetmap.org/relation/12345',
width: 1200, height: 630, format: 'jpeg' },
headers: { 'X-API-Key' => ENV['SNAPAPI_KEY'] })
```
Free tier 200/month if you want to prototype without commitment.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/2965#issuecomment-3953308983
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/issues/2965/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev