Search: Application Search

This endpoint allows you to search your POOL distribution for specific content. Below is a breakdown for how to format the search string for a more targetted search.

Search String Formatting

Example) artist:katy+perry+track:roar+mix:intro+genre:dance+bpm:100,200

Application Search Specification

Parameters: Header variables:
  1. userid: integer
  2. token: string
JSON returned:

Application Search Workflow

  1. URL: https://api.promoonly.com/search/[FORMATTED_SEARCH_STRING]
  2. Header: Authorization: Bearer Base64(userid:token)
  3. Method: GET
  4. Returned: JSON

    Example JSON Output

    {
        "message": "Search field results: Artist field set.",
        "results_found": 3,
        "search_method": "ts",
        "search_results":
        [
            {
                "artist": "Skip Marley & H.E.R. f./Wale",
                "bpm": 100,
                "content_warning": false,
                "downloaded": 0,
                "duration": 221,
                "end": "",
                "explicit": 0,
                "genre": "R&B",
                "id": 375800,
                "label": "Tuff Gong/Island/Republic",
                "media": "mp3,m4a,wav",
                "mix": "Remix",
                "modified": 1587397331,
                "release": "Urban Club May 2020",
                "release_date": "2020-04-20",
                "release_img": "https://pomed.promoonly.com/issue_imgs/uc0520_web.png",
                "releaseid": 56287,
                "title": "Slow Down",
                "titleid": 629165,
                "track_order": 24,
                "trackid": 375800,
                "type": 2
            },
            {
                "artist": "Skip Marley & H.E.R. feat Wale",
                "bpm": 100,
                "content_warning": false,
                "downloaded": 0,
                "duration": 222,
                "end": "Cold",
                "explicit": 0,
                "genre": "Reggae",
                "id": 375522,
                "label": "Island",
                "media": "mp3,m4a,wav",
                "mix": "Remix",
                "modified": 1587134569,
                "release": "Slow Down (Remix)",
                "release_date": "2020-04-17",
                "release_img": "https://s3.amazonaws.com/pool.images/56757.jpg",
                "releaseid": 56757,
                "title": "Slow Down",
                "titleid": 628983,
                "track_order": 1,
                "trackid": 375522,
                "type": 2
            },
            {
                "artist": "Lonr. f./H.E.R.",
                "bpm": 79,
                "content_warning": false,
                "downloaded": 0,
                "duration": 212,
                "end": "Fade",
                "explicit": 0,
                "genre": "R&B",
                "id": 375233,
                "label": "Epic",
                "media": "mp3,m4a,wav",
                "mix": "",
                "modified": 1586973737,
                "release": "Express Audio DFF April 2020: Week 3",
                "release_date": "2020-04-15",
                "release_img": "https://pomed.promoonly.com/issue_imgs/0420-ExpAud-wk3_web.png",
                "releaseid": 56425,
                "title": "Make The Most",
                "titleid": 628834,
                "track_order": 15,
                "trackid": 375233,
                "type": 2
            }
        ]
    }

Examples

  1. PHP (using cURL):

    <?php
        $userid = 1;
        $token = "8b26e1e4f3f5e00a888807e605565c47";

        $api_url = "https://api.promoonly.com/search/artist:katy+perry+track:roar+mix:intro+genre:dance+bpm:100,200";

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $api_url);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".base64_encode($userid.":".$token)));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $api_result = curl_exec($ch);
        curl_close($ch);

        $api_obj = json_decode($api_result);
    ?>
  2. Javascript (using jQuery):

    function b64EncodeUnicode(str)
    {
        return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
            function toSolidBytes(match, p1)
            {
                return String.fromCharCode('0x' + p1);
            }));
    }

    var userid = 1;
    var token = "8b26e1e4f3f5e00a888807e605565c47";
    var auth_str = "Bearer " + b64EncodeUnicode(userid + ":" + token);

    $.ajax({
        type: "GET",
        url: "https://api.promoonly.com/search/artist:katy+perry+track:roar+mix:intro+genre:dance+bpm:100,200",
        headers: { "Authorization": auth_str },
        dataType: "json",
        success: function (data)
        {
            console.log(data);
        }
    });
  3. Python (using requests):

    #!/usr/bin/env python

    import requests
    import base64
    import urllib

    userid = 1
    token = "8b26e1e4f3f5e00a888807e605565c47"

    b64_key = base64.b64encode("%s:%s" % (userid, token))
    headers = {"Authorization": "Bearer %s" % b64_key}
    api_url = "https://api.promoonly.com/search/artist:katy+perry+track:roar+mix:intro+genre:dance+bpm:100,200"
    result_return = requests.get(api_url, headers=headers)

    print(result_return.text)