An open API service indexing awesome lists of open source software.

https://github.com/paulogr/api-opengraph-image


https://github.com/paulogr/api-opengraph-image

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Open Graph Image API

A runtime service to return optimized Open Graph images from a URL. Works with:

1. ``
1. ``
1. ``
1. ``

## Usage

URLs have the formats:

```
/:url/
/:url/:size/
/:url/:size/:format/
```

* `url` must be URI encoded.
* `size` (optional) can be `small` (375×_), `medium` (650×_), or `auto` (keep original width)
* `format` must by an output image format supported by [Eleventy Image](https://www.11ty.dev/docs/plugins/image/)

## Deploy your own

Deploy to Netlify

## Demos

OpenGraph Image for netlify.com

OpenGraph Image for 11ty.dev

OpenGraph Image for zachleat.com

### Advanced: Manual Cache Busting

If the images aren’t updating at a high enough frequency you can pass in your own cache busting key using an underscore prefix `_` after your URL.

This can be any arbitrary string tied to your unique build, here’s an example that uses today’s date.

```
/:url/_20210802/
/:url/:size/_20210802/
/:url/:size/:format/_20210802/
```