Profile: has-audio

Profile Schema

The has-audio profile designates a document that has audio assets. While a document can contain audio assets without the has-audio profile, clients will be looking for assets in the audio array provided by this profile, so it is highly recommended that any document with audio implements this profile.

Note that premium audio (which is only a property of podcast episodes) is specified by the podcast-episode profile and is not covered here.

Structure

has-audio specifies a required audio attribute represented by a list of links to audio assets. The rels on the link objects provide further information on the type of audio linked to. The following are valid rel values for this array; other values will be rejected.

  • primary - The “featured” audio for this document
  • headline - When rendering this content visibily, this is the audio that should be featured; this is often (but not always) the same as primary
  • nprone-override - Fallback audio for NPR One if primary is not available
  • intro - Audio that should be played before the primary audio is played
  • promo - Promotional audio

The audio array must contain one or more links; all links must be asset links that begin with #/.

Example has-audio document

{
  "id": "12345",
  "profiles": [
    {
      "href": "/v1/profiles/has-audio"
    },
    {
      "href": "/v1/profiles/document"
    },
    {
      "href": "/v1/profiles/story",
      "rels": [
        "type"
      ]
    },
  ],

  "assets": {
    "5678": {
      "id": "5678",
      "profiles": [
        {
          "href": "/v1/profiles/audio",
          "rels": [
            "type"
          ]
        }
      ],
      "title": "Freezing all night, freezing all day: life on Hoth for a rebel commander",
      "source": "77e9d521-3340-47ea-a3d8-b10b98b1e481",
      "enclosures": [
        {
          "href": "https://npr-audio-host.org/life-on-other-planets/episode-3.mp3",
          "rels": [
            "sponsored"
          ],
          "type": "audio/mpeg"
        }
      ]
    }
  },

  "audio": [
    {
      "href": "#/assets/5678",
      "rels": [
        "primary",
        "headline"
      ]
    }
  ]
}

© 2024 npr