PreviewAPI version 0.4.0

oEmbed

Turn a prompt link into an embeddable recorder, the way blog and CMS unfurlers do.

If you run a CMS, a newsletter tool or anything else that turns pasted links into embeds, you can support Vox Pop prompt links with oEmbed. Give the endpoint a prompt's URL and it returns the HTML for a working recorder, plus a title and a preview image.

The endpoint needs no API key.

The endpoint

Endpoint
GET https://voxpop.audio/api/oembed
  • url (required): a prompt link, in the form https://voxpop.audio/@handle/promptId. That's the link podcasters share.
  • maxwidth: the widest the embed may be, in pixels. Default and maximum 480.
  • maxheight: the tallest the embed may be, in pixels. Default and maximum 600.
  • format: only json is supported, which is the default.

Example

curl
curl "https://voxpop.audio/api/oembed?url=https%3A%2F%2Fvoxpop.audio%2F%40myshow%2F3mi5a5dynk2n3&maxwidth=400"
Response
{
  "version": "1.0",
  "type": "rich",
  "provider_name": "Vox Pop",
  "provider_url": "https://voxpop.audio",
  "title": "What should we cover next season?",
  "author_name": "My Show",
  "author_url": "https://voxpop.audio/@myshow",
  "width": 400,
  "height": 600,
  "html": "<iframe src=\"https://embed.voxpop.audio/myshow/3mi5a5dynk2n3\" width=\"400\" height=\"600\" frameborder=\"0\" allow=\"microphone\" ...></iframe>",
  "thumbnail_url": "https://voxpop.audio/og/myshow/3mi5a5dynk2n3.png",
  "thumbnail_width": 1200,
  "thumbnail_height": 630
}

Insert html into your page as it is. It's an iframe pointing at https://embed.voxpop.audio, which is built to be framed by any site. Keep the allow="microphone; screen-wake-lock" attribute. Without microphone the browser won't let a listener record. Without screen-wake-lock a phone can lock mid-reply, which stops the recording.

Use thumbnail_url when you show a link preview instead of the live recorder. It's a 1200 × 630 PNG.

Responses can be cached for five minutes. The endpoint allows 60 requests a minute from one client.

Errors

Errors come back as JSON, with these statuses:

  • 400: no url parameter.
  • 404: the URL isn't a Vox Pop prompt link, or the prompt doesn't exist.
  • 501: a format other than json.
  • 429: too many requests. Wait a minute and retry.

If you only want the recorder on a page you control, the embed widget is simpler.