Documentation

GraphQL API: Playback

Get new audio URL for expired audio

Since audio URLs are short lived, you may need to request a new audio URL for playback. This would usually be the case if you store audio URLs locally for a period of time. The API is idempotent and can be called as often as necessary. Each time it’s called, a new audio URL will be generated.

Query



{
  playback {
    current (deviceUuid: "deviceXYZ") {
      ... on TrackItem {
        audioUrl
        interactions
        index
        trackToken
        track {
          duration
          art {
            url (width: 150, height: 150)
          }
          artist {
            name
          }
        }
      }
    }
  }
}

* Add your OAuth bearer token to the Authorization header



curl 'https://ce.pandora.com/api/v1/graphql/graphql' \
  -H 'Authorization: Bearer ' \
  -H 'Content-Type: application/json' \
  -d '{"operationName":null,"variables":{},"query":"{  playback { current(deviceUuid: \"deviceXYZ\") { ... on TrackItem { audioUrl interactions index trackToken track { duration art { url(width: 150, height: 150) } artist { name } } } }  }}"}'

Response



{
  "data": {
    "playback": {
      "current": {
        "audioUrl": "https://t3-4.p-cdn.us/access/4801370763899556419?version=5&lid=1375438868&token=LUZc3vC8xvkGaQdrq/0xBMGDAjY/a8dmJfou5L987iBzw9lAhC0Z8kAY5HX3f+VVFQSfhbOMYR4UT2/7AzCO5unIJ7FB+w+98no8Q/TTOE5CG2+ku0X5ERhkHEHW1D3YB6vclvUw8FKSBKKo99+5u80EANpHFSGymakJ+PY8g0pDYeLerxaKh/lBrIlL94xlcJ0Y+MGzFzXyMvNTggRxr476Z1hpgZ6laGjhUHt1zfOI6B09dvba4f4jR1wGU9Ll+L22aBIPnmMifMsxzqZuqaKiHTVn/n2pJLy5RW08Gs+IT3zbJfcGiUFeSq4FXzukpuov1FOUQkj3BViQ3B8I+w==",
        "interactions": [
          "SKIP",
          "REPLAY",
          "THUMB"
        ],
        "index": 1,
        "trackToken": "P8q7bU-LSkOkouJlpPz4KYHlxV0EZ2D7J4_lo0MAQJXK-rq7vhAbsIZMs7AJAVLagIB9JlMb2sEBFNQuSrSvuODO4yO6Rm66e",
        "track": {
          "duration": 157,
          "art": {
            "url": "https://dyn-images.p-cdn.com/?l=images%2Fpublic%2Fint%2F4%2F2%2F5%2F9%2F081227889524%3Acover()&w=150&h=150"
          },
          "artist": {
            "name": "The Cure"
          }
        }
      }
    }
  }
}