Developer API documentation

Top cities and countries

In addition to artist timeseries, for bittorrent and selected social networks (currently twitter and myspace), we provide access to ranked lists (similar to Charts) of the current distribution of peers (in torrent swarms) or followers/friends (on twitter/myspace). The calls are constructed as follows:

torrent peer locations at - /artist/<id>/downloads/bittorrent/location/[country|city] (value is number of peers)

social network fan locatons at - /artist/<id>/demographics/[myspace|twitter]/location/[country|city] (value is percentage of fans)

examples

some examples, here’s Tool’s top cities for bittorrent peer location:
http://api.semetric.com/artist/e5f7be85c9b94d70b5d3dc13ee997c56/downloads/bittorrent/location/city?token=YOURAPIKEY

This will return:

{
 "response": {
     "data": [
         {
             "city": {
                 "class": "city",
                 "latitude": "34.0522",
                 "longitude": "-118.2437",
                 "name": "Los Angeles CA",
                 "region": {
                     "class": "region",
                     "code": "",
                     "continent": {
                         "class": "continent",
                         "code": "NA",
                         "name": "North America"
                     },
                     "country": {
                         "class": "country",
                         "code": "US",
                         "name": "United States"
                     }
                 }
             },
             "value": 7090
         },
         {
             "city": {
                 "class": "city",
                 "latitude": "40.7144",
                 "longitude": "-74.0060",
                 "name": "New York NY",
                 "region": {
                     "class": "region",
                     "code": "",
                     "continent": {
                         "class": "continent",
                         "code": "NA",
                         "name": "North America"
                     },
                     "country": {
                         "class": "country",
                         "code": "US",
                         "name": "United States"
                     }
                 }
             },
             "value": 6208
         },
         ...
     ]
 },
 "success": true
 }
and here’s the top countries for myspace fans (also Tool):
http://api.semetric.com/artist/e5f7be85c9b94d70b5d3dc13ee997c56/demographics/myspace/location/country?token=YOURAPIKEY

This will return:

{
"response": {
    "data": [
        {
            "country": {
                "code": "US",
                "name": "United States"
            },
            "value": 3779
        },
        {
            "country": {
                "code": "DE",
                "name": "Germany"
            },
            "value": 306
        },
        {
            "country": {
                "code": "GB",
                "name": "United Kingdom"
            },
            "value": 157
        },
        ...
    ]
},
"success": true
}