Audioburst Web API V2

2.1 Get Personalized Top Stories

Get a playlist of top stories personalized for each user’s listening identity.

Starts with a generic mix of the newest and most popular bursts across all categories. It is gradually fine-tuned to each user’s preferences and automatically customized by the Audioburst platform.

Try it

Request URL

Request parameters

string

The user's device.

Optional values are taken from the Get Supported Devices API.

(optional)
string

Get personalized playlist by unique userId, see Register User API.

(optional)
string

Comma separated Latitude and Longitude of the user location. This allows Audioburst to add location based stories.

Request headers

string
Subscription key which provides access to this API. Found in your Profile.

Request body

Response 200

On success, the response body contains a Response object.

Response:
Key Value Type Value Description
type String Type of returned response or response message: “playlist”, “single”, “message”
queryId Long The query id that was made for this response
query String The query that was made for this response
actualQuery String The query that was used for searching
bursts Array of bursts List of bursts that composes the response
imageURL String Url for an image corresponding to the query
nextPage String Url to get the next page of the query
Burst:
Key Value Type Value Description
index Short index of burst in the array
burstId String Burst id
creationDate DateTime Burst creation date in epoch
creationDateISO DateTime Burst creation date in iso8601
title String The burst title
quote String A significant quote from the burst text
score Float A score between 0-10 marking match level of the burst to the query
text String Burst transcript text
duration Float Burst length in seconds
category String List of categories burst is classified for
keywords Array of Strings List of keywords in the burst
entities Array of Strings List of entities in the burst
source Source object Burst source information
contentURLs contentURLs object URLs of burst
debugTrace DebugTrace object Debug data
transcript object null
Source Object:
Key Value Type Value Description
sourceId Short Id of burst source
sourceName String Source name
sourceType String Source Type: Radio or Podcast
showID String Show id of burst
showName String Show name of the burst
position Float Burst start time in source
audioURL String source audio file url
imageURL String Url for an image corresponding to the source
titleSource String Url of page title was taken from
location Location object Geolocation of to the source
episodeName String Name of episode burst was taken from
contentURLs:
Key Value Type Value Description
burstURL String Url to get more data on the burst
audioURL String burst audio file url
imageURL Array of String Array of Urls for an image corresponding to the burst
searchSiteURL String Url of burst in AudioBurst search web site
Location:
Key Value Type Value Description
type String Location type
coordinates float pair location coordinates
text String Name of location

Example

{
  "type": null,
  "queryID": 1906128,
  "query": "Top Stories Feed",
  "actualQuery": "Top Stories",
  "bursts": [{
    "index": 0,
    "burstId": "cd34d7ff-08a8-4c81-a10e-b63e6562abf2",
    "creationDate": "\/Date(1511239310908)\/",
    "creationDateISO": "2017-11-21T04:41:50.9080000Z",
    "title": "Uh diplomats moved uh went to the white house and were hosted by the president and at that point",
    "quote": "Uh diplomats moved uh went to the white house and were hosted by the president and at that point",
    "score": 0,
    "text": "Uh with the washer 2016 campaign business and the collusion aspect of alleged collusion aspect of it uh because uh accused of of of uh obstructing judicial proceedings so there is that precedent and then.",
    "duration": 165.14999999999964,
    "category": "news.us.politics",
    "keywords": ["uh muller", "fbi uh", "alleged collusion aspect", "obstruction case", "insisted rationales", "impeachment offence", "white house", "great weight", "campaign business", "high crime", "judicial proceedings", "president"],
    "entities": ["Colmey", "Kremlin", "President Trump", "White House", "Russia", "Kony", "Muller", "Clinton", "John", "Obstruction Of Justice", "Nixon", "FBI"],
    "source": {
      "sourceId": 11543,
      "sourceName": "WPRO 630AM",
      "sourceType": null,
      "showId": 229,
      "showName": "The John Batchelor Show",
      "position": 2145.03,
      "audioURL": "https://storageaudiobursts.blob.core.windows.net/temp/11543_Mueller to interview top-level White House officials_t.mp3",
      "imageURL": "https://sapi.audioburst.com/burst/stationimage/cd34d7ff-08a8-4c81-a10e-b63e6562abf2",
      "titleSource": null,
      "location": {
        "type": "Point",
        "coordinates": [-71.422222, 41.823611],
        "text": null
      },
      "episodeName": null
    },
    "contentURLs": {
      "burstURL": "https://sapi.audioburst.com/v2/burst?burstId=cd34d7ff-08a8-4c81-a10e-b63e6562abf2\u0026queryId=1906128\u0026appKey=58e9a502bf634610b033081935d39c85\u0026device=web",
      "audioURL": "https://sapi.audioburst.com/audio/play/1905972/temp/cd34d7ff-08a8-4c81-a10e-b63e6562abf2/82ade2ab-c59b-4dec-9373-17eab9032d7c_48.mp3?userId=\u0026appName=58e9a502bf634610b033081935d39c85",
      "imageURL": ["https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_US_01_200x200.png", "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_US_01_600x315.png", "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_US_01_1200x630.png"],
      "searchSiteURL": "https://search.audioburst.com/burst/cd34d7ff-08a8-4c81-a10e-b63e6562abf2/2017/11/21/Uh-diplomats-moved-uh-went-to-the-white-house-were-hosted-by-the-president-at-that-point?queryID=1906128"
    },
    "DebugTrace": null,
    "transcript": null
  }, {
    "index": 0,
    "burstId": "657903f0-1d8a-4e10-8439-a8165cced446",
    "creationDate": "\/Date(1511251511583)\/",
    "creationDateISO": "2017-11-21T08:05:11.5830000Z",
    "title": "The north was originally put on the us terrorism list for the 1987 bombing of a korean air flight",
    "quote": "The north was originally put on the us terrorism list for the 1987 bombing of a korean air flight",
    "score": 0,
    eighty five billion dollar bid to acquire time warner npr salinas shell uk has more on what could be one of the.",
    "duration": 97.02,
    "category": "news.foreign",
    "keywords": ["sexual misconduct allegations", "trial snyder npr", "share striking commonalities", "designation president trump", "sanctions", "bombing", "giles", "salinas", "syria", "roses", "debates"],
    "entities": ["Donald Trump", "Salinas Shell Uk", "Nuclear Weapons", "President Trump", "United States", "CBS", "Washington Post", "Bloomberg Tv", "Shea Stevens", "Eighty Five Billion Dollar"],
    "source": {
      "sourceId": 8214,
      "sourceName": "KQED Radio",
      "sourceType": null,
      "showId": 159,
      "showName": "The Takeaway",
      "position": 2.97,
      "audioURL": "https://storageaudiobursts.blob.core.windows.net/temp/8214_CBS News suspends Charlie Rose following sexual harassment report_t.mp3",
      "imageURL": "https://sapi.audioburst.com/burst/stationimage/657903f0-1d8a-4e10-8439-a8165cced446",
      "titleSource": null,
      "location": {
        "type": "Point",
        "coordinates": [-119.804307, 36.768788],
        "text": null
      },
      "episodeName": null
    },
    "contentURLs": {
      "burstURL": "https://sapi.audioburst.com/v2/burst?burstId=657903f0-1d8a-4e10-8439-a8165cced446\u0026queryId=1906128\u0026appKey=58e9a502bf634610b033081935d39c85\u0026device=web",
      "audioURL": "https://sapi.audioburst.com/audio/play/1905973/temp/657903f0-1d8a-4e10-8439-a8165cced446/4a179ad5-4aa9-4906-96b1-55b539eaf1ee_48.mp3?userId=\u0026appName=58e9a502bf634610b033081935d39c85",
      "imageURL": ["https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_world_01_200x200.png", "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_world_01_600x315.png", "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_world_01_1200x630.png"],
      "searchSiteURL": "https://search.audioburst.com/burst/657903f0-1d8a-4e10-8439-a8165cced446/2017/11/21/The-north-was-originally-put-the-us-terrorism-list-for-the-1987-bombing-of-a-korean-air-flight?queryID=1906128"
    },
    "DebugTrace": null,
    "transcript": null
  }],
  "message": null,
  "imageURL": null,
  "nextPage": null
}

Code samples

@ECHO OFF

curl -v -X GET "https://developersapi.audioburst.com/v2/topstories?device={device}?userId={string}&location={string}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            // Request parameters
            queryString["userId"] = "{string}";
            queryString["location"] = "{string}";
            var uri = "https://developersapi.audioburst.com/v2/topstories?device={device}&" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://developersapi.audioburst.com/v2/topstories?device={device}");

            builder.setParameter("userId", "{string}");
            builder.setParameter("location", "{string}");

            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
            "userId": "{string}",
            "location": "{string}",
        };
      
        $.ajax({
            url: "https://developersapi.audioburst.com/v2/topstories?device={device}&" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://developersapi.audioburst.com/v2/topstories?device={device}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"userId={string}",
                         @"location={string}",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://developersapi.audioburst.com/v2/topstories?device={device}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'userId' => '{string}',
    'location' => '{string}',
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
    # Request parameters
    'userId': '{string}',
    'location': '{string}',
})

try:
    conn = httplib.HTTPSConnection('developersapi.audioburst.com')
    conn.request("GET", "/v2/topstories?device={device}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
    # Request parameters
    'userId': '{string}',
    'location': '{string}',
})

try:
    conn = http.client.HTTPSConnection('developersapi.audioburst.com')
    conn.request("GET", "/v2/topstories?device={device}&%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://developersapi.audioburst.com/v2/topstories?device={device}')

query = URI.encode_www_form({
    # Request parameters
    'userId' => '{string}',
    'location' => '{string}'
})
if query.length > 0
  if uri.query && uri.query.length > 0
    uri.query += '&' + query
  else
    uri.query = query
  end
end

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body