Audioburst Web API V2

2.2 Get Bursts by Category

Get a playlist of top stories for a given category.

Use the Get Supported Categories API call to view all supported categories.

Try it

Request URL

Request parameters

string

A category to return top stories by.

Optional values are taken from the Get Supported Categories API.

string

The user's device.

Optional values are taken from the Get Supported Devices API.

(optional)
string

Filter content by source type parameter. Default parameter is MIX.

Optional values are taken from the Get Supported Source Types API.

(optional)
string

Earliest time and date to get burst by in iso8601.

(optional)
string

Unique userId, see Register User API.

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": 1906163,
  "query": "Business Feed",
  "actualQuery": "Business",
  "bursts": [
    {
      "index": 0,
      "burstId": "ApBrW7XwPnrN",
      "creationDate": "2017-11-21T02:41:49.791Z",
      "creationDateISO": "2017-11-21T02:41:49.791Z",
      "title": "Woman Hurt By Exploding Air Bag Urges Owners To Get Cars Fixed « CBS Detroit",
      "quote": "In nineteen sixty nine manson a scruffy exconvict with a magnetic hold on young women",
      "score": 0,
      "text": "The age of eighty three in nineteen sixty nine manson a scruffy exconvict with a magnetic hold on young women currently are in birmingham godal executive say the city of detroit has.",
      "duration": 71.789999999999964,
      "category": "Business",
      "keywords": [
        "takata airbag inflater",
        "faulty inflators gugel",
        "takata inflators",
        "unease henry street",
        "free repairs",
        "car owners"
      ],
      "entities": [
        "Manson",
        "Honda",
        "Stephanie Erdmann",
        "Officer",
        "Gugel",
        "Executive",
        "Detroit",
        "Los Angeles",
        "Little Caesars Arena",
        "Birmingham",
        "Forty Three Percent",
        "Three Days"
      ],
      "source": {
        "sourceId": 12152,
        "sourceName": "Newsradio 950 WWJ",
        "sourceType": "Radio",
        "showId": 43,
        "showName": "24 Hour News",
        "position": 1365.78,
        "audioURL": "http://storageaudiobursts.blob.core.windows.net/temp/12152_2017112012_t.mp3",
        "imageURL": "https://sapi.audioburst.com/burst/stationimage/1bf5b74d-b519-4b05-89dc-c1d9f1917746",
        "titleSource": "http://detroit.cbslocal.com/2017/11/20/woman-hurt-by-air-bag-urges-action/",
        "location": {
          "type": "Point",
          "coordinates": [
            -83.239722,
            42.019167
          ],
          "text": null
        },
        "episodeName": null
      },
      "contentURLs": {
        "burstURL": "https://sapi.audioburst.com/v2/burst?burstId=ApBrW7XwPnrN&queryId=1906163&appKey=58e9a502bf634610b033081935d39c85&device=web",
        "audioURL": "https://sapi.audioburst.com/audio/repo/play/web/ApBrW7XwPnrN.mp3?userId=&appName=58e9a502bf634610b033081935d39c85",
        "imageURL": [
          "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_business_01_200x200.png",
          "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_business_01_600x315.png",
          "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_business_01_1200x630.png"
        ],
        "searchSiteURL": "https://search.audioburst.com/burst/ApBrW7XwPnrN/2017/11/20/Woman-Hurt-By-Exploding-Air-Bag-Urges-Owners-To-Get-Cars-Fixed-%c3%82%c2%ab-CBS-Detroit"
      },
      "DebugTrace": null,
      "transcript": null
    },
    {
      "index": 0,
      "burstId": "9ogy4GJG7eAv",
      "creationDate": "2017-11-21T02:35:42.653Z",
      "creationDateISO": "2017-11-21T02:35:42.653Z",
      "title": "United States, White House and George W Bush discussed on Rush Limbaugh",
      "quote": "The moves expected to generate an investment of twenty two million dollars creating a hundred and five jobs",
      "score": 0,
      "text": "Olding tower of the fisher building this he's the great voice of the great lakes seven sixty wjr detroit been killed in texas by illegal immigrants using rocks as weapons the president says this is why the.",
      "duration": 145.44,
      "category": "Business",
      "keywords": [
        "north korea",
        "o'clock good afternoon",
        "new downtown detroit",
        "american automotive headquarters",
        "offroad vehicle",
        "great lakes",
        "marie osborne"
      ],
      "entities": [
        "United States",
        "White House",
        "George W Bush",
        "Ohio College",
        "Highland Park",
        "Caesars Arena",
        "India",
        "Pontiac Mahindra",
        "Auburn Hills",
        "Twenty Two Million Dollars",
        "Forty Six Degrees",
        "Thirteen Year",
        "Twelve Year"
      ],
      "source": {
        "sourceId": 11361,
        "sourceName": "WJR 760",
        "sourceType": "Radio",
        "showId": 235,
        "showName": "Rush Limbaugh",
        "position": 29.28,
        "audioURL": "http://storageaudiobursts.blob.core.windows.net/temp/11361_2017112014_t.mp3",
        "imageURL": "https://sapi.audioburst.com/burst/stationimage/06497be1-7726-44c7-b9d2-205c95185572",
        "titleSource": null,
        "location": {
          "type": "Point",
          "coordinates": [
            -83.077447,
            42.369647
          ],
          "text": null
        },
        "episodeName": null
      },
      "contentURLs": {
        "burstURL": "https://sapi.audioburst.com/v2/burst?burstId=9ogy4GJG7eAv&queryId=1906163&appKey=58e9a502bf634610b033081935d39c85&device=web",
        "audioURL": "https://sapi.audioburst.com/audio/repo/play/web/9ogy4GJG7eAv.mp3?userId=&appName=58e9a502bf634610b033081935d39c85",
        "imageURL": [
          "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_business_01_200x200.png",
          "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_business_01_600x315.png",
          "https://storageaudiobursts.blob.core.windows.net/site/images/CategoryIcons/AB_API_business_01_1200x630.png"
        ],
        "searchSiteURL": "https://search.audioburst.com/burst/9ogy4GJG7eAv/2017/11/20/United-States-White-House-George-W-Bush-discussed-Rush-Limbaugh"
      },
      "DebugTrace": null,
      "transcript": null
    }
  ],
  "message": null,
  "imageURL": null,
  "nextPage": null
}

Code samples

@ECHO OFF

curl -v -X GET "https://developersapi.audioburst.com/v2/topstories/category?category={category}&device={device}?sourceType={string}&fromDate={string}&userId={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["sourceType"] = "{string}";
            queryString["fromDate"] = "{string}";
            queryString["userId"] = "{string}";
            var uri = "https://developersapi.audioburst.com/v2/topstories/category?category={category}&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/category?category={category}&device={device}");

            builder.setParameter("sourceType", "{string}");
            builder.setParameter("fromDate", "{string}");
            builder.setParameter("userId", "{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
            "sourceType": "{string}",
            "fromDate": "{string}",
            "userId": "{string}",
        };
      
        $.ajax({
            url: "https://developersapi.audioburst.com/v2/topstories/category?category={category}&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/category?category={category}&device={device}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                         @"sourceType={string}",
                         @"fromDate={string}",
                         @"userId={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/category?category={category}&device={device}');
$url = $request->getUrl();

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

$request->setHeader($headers);

$parameters = array(
    // Request parameters
    'sourceType' => '{string}',
    'fromDate' => '{string}',
    'userId' => '{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
    'sourceType': '{string}',
    'fromDate': '{string}',
    'userId': '{string}',
})

try:
    conn = httplib.HTTPSConnection('developersapi.audioburst.com')
    conn.request("GET", "/v2/topstories/category?category={category}&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
    'sourceType': '{string}',
    'fromDate': '{string}',
    'userId': '{string}',
})

try:
    conn = http.client.HTTPSConnection('developersapi.audioburst.com')
    conn.request("GET", "/v2/topstories/category?category={category}&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/category?category={category}&device={device}')

query = URI.encode_www_form({
    # Request parameters
    'sourceType' => '{string}',
    'fromDate' => '{string}',
    'userId' => '{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