Pull SoundCloud view count for individual track - soundcloud

Im wanting to pull play count data for an individual track on SoundCloud. I've seen various examples that pull total plays for all users tracks, but not for individual tracks. I'm very new to coding and will probably not be the one handling the final coding, but was just wondering if anyone already has the answer.
For example, I would like to keep track of the play count for this track:
https://soundcloud.com/llucid/fish-grease-prod-louis-futon
If you guys can help me, I'd truly appreciate it.
Kind regards

The previous question wasn't so straightforward because a users total track playcount for all tracks is not readily available. But playcount for a single track is right there for you to get.
I find myself working with track ids more often than urls to tracks. But if you just have the url, you can still resolve it to a full track resource, which would include the playcount.
I don't know what language you use, but I use php and heres the code to get that tracks playcount. But I'll tell you right now, unless you can make some sense of the api docs (located here) then i think you are in over your head. This code is copy/paste from api docs.
<?php
require_once 'Services/Soundcloud.php';
// create a client object with your app credentials
$client = new Services_Soundcloud('YOUR_CLIENT_ID');
// a permalink to a track
$track_url = 'https://soundcloud.com/llucid/fish-grease-prod-louis-futon';
// resolve track URL into track resource
$track = json_decode($client->get('resolve', array('url' => $track_url)), true);
$track_playcount = $track['playback_count'];
echo $track_playcount;

Related

How do I get the complete track history of a Deezer user?

I want to analyse my music consumption on Deezer.
Researching resulted in their rest api but the amount of entries in the user history seems to be limited (see https://stackoverflow.com/a/19497151/9909548 to navigate through all entries).
In my case, it resulted in only about 140 tracks which should be thousands.
From now on I could regularly store the results of that request but all data till now would be lost.
I'm aware that, by EU law, I could request all stored user data and parse that (in case I get it digitally) but I would not consider that a solution.
Is there a different api call to get the complete history or another api or some other way to get this?
There is no other way to access the entire history:
Deezer Support on 05.12.2020
Hello, Thanks for your email, apologies for the delay in getting back to you. XXX from Support here
https://www.deezer.com/app/stateeztics/
that is the best tool, but else sadly we do not have data analysis tools or data, besides recently played. Other option though: 2020 highlights (in Music)
Kind regards, XXX
The recommended app is stuck when opened and Deezer is slowly stopping their support for app extensions anyway.

Start and end location for a completed trip with uber-api

my girlfriend and I have some cool statistics to provide for an uber user, but without start and end location, is basically impossible.
Given the current API, that's what we tried:
GET /v1.2/history: provide some information, but related to location, only the city where the ride happened
GET /v1/requests/{request_id}: give location only for in_progress rides
GET /v1/requests/{request_id}/map: here was the closest place we got. After some element inspection we figure it out that there is a json nested in the html that provide this information. But again, when generating maps for each ride, most of them gave us this error: (that based on answer that we found in another question here, its because maps are available only for a couple of days): {'code': 'conflict', 'message': 'Unable to generate map for trip "6a31e621-2c6f-4422-ac74-e9f382b346c5"'}
There is some way to retrieve this information or has someone successfully done this?
I mean, I don't know if they hide this information because privacy concerns. But, during some time we have the information. It's all about timing, If this is because a privacy concern, why they provide this temporarily, then, hide. If anyone know about the way that it works (you can make sure they search more than us about this), they are already collecting this information.
We do not currently provide start and end location for all trips via the history end point. Currently, we only provide start / end location for in progress trips. Your understanding above is correct.

How to fetch playback statistics

I'd like to know if it's possible (and if yes: how) to fetch statistics for our soundcloud tracks via the soundcloud API.
I know that i can get the current playback count of my tracks but is it possible to get the playback count of yesterday and so on to draw a custom graph ?
Or do i have to poll the api and record the data myself?
Not officially. Latest and official api does not support this feature yet. It voilates the tos.
Check that question first, before you read further:
soundcloud: Is api-v2 allowed to be used and is there documentation on it?
For experimental use, you can try this:
soundcloud.com/{username}/stats
Is a good starting point to take a deeper look on the networks tab in the console.
Example calls:
totals -> all tracks
https://api-v2.soundcloud.com/users/soundcloud:users:1672444/stats/totals?from=1427846400000&to=1428364800000&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&app_version=1d6991e
plays -> individual tracks
https://api-v2.soundcloud.com/users/soundcloud:users:1672444/tracks/soundcloud:tracks:148976759/stats/timeseries/plays?from=1427846400000&to=1428364800000&resolution=day&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&app_version=1d6991e
The second call will give you, what you want - an array with the daily plays.
To make the calls working i had to manipulate the request headers.
Origin https://soundcloud.com
Referer https://soundcloud.com
Host api-v2.soundcloud.com
Authorization (copied from network tab)

Instagram API: Get the oldest images first based on tagname

I recently developed an app using the Instagram API, But I faced some problems with it. (I got struck)
This app is not calling the api and getting images in the real-time. Instead, it calls the api once a week and store images in the database based on a specific hashtag. I see that their api is designed in a way to call it in real time and pull images, because it has this "recent" in its url, and it only provides 20 results. So every time a user reaches the end, it will load the next 20, until u reach the end.
However, in my case, When I pull the images every week, at one point, I will reach to the oldest image, and from that point I will be stopped, because Im going from Newest to the oldest. So I want to get data as from oldest to newest.( Actually I want to get the opposite of what's offered by instagram.) They have not provided any option to sort them in their docs.
Im thinking of a solution for this, but I can't wrap my head around it. So I will be much thankful if you guys can direct me in the right path.
I searched Google, viewed old questions in SO, but I didn't find the answer.
Edit : Im planning to fetch data starting from the Oldest one like this. (Since I know the min_tag_id, because I ran this once completely).
https://api.instagram.com/v1/tags/my_tag/media/recent?&client_id=xxxxxxxxxxxxxxx&min_tag_id=1408983759354183
where min_tag_id is of the oldest image. So everytime I will be calling to the min_tag_id. Is it a good solution?
Yes, using the min_tag_id and max_tag_id is the solution.
Have a look at this answer: Instagram Search for a tag within particular date range

In-App Notifications?

I'm trying to create functionality in my app that would allow me to release news updates (Via a server) to those using the app, similar to what is found in Doodle Jump:
http://farm8.staticflickr.com/7143/6463110847_d485681dac.jpg
Any sample code or ideas would be helpful.
You'll probably need to create an API/web service that your app calls on launch (or when entering foreground)...you could populate that with a database that just gives the entries since the last sync...or just returns some response that you've set up. The response should be JSON or XML formatted (I vote JSON) and then in your app, you call it, parse the response, and place/manipulate it however necessary
http://mobileorchard.com/tutorial-json-over-http-on-the-iphone/
There are a lot of options here. In any case you will need a web server that hosts these news postings. The route that I would take is some kind of blog site, where you can easily manage posts. Then upon launching the app you make a web service call to said blog and get the news posts. You will need to keep track locally of which posts were read by the user in order to keep the badge count correct.
You could also roll your own server, but I don't really see the point for something so simple.
Another option is a web-service such as Parse
This question is too vague for code samples as we would be essentially writing the entire solution for you in order for it to make sense.
If you have further questions into how to leverage these web services, how to load the feed, how to display it etc... Break it up across multiple questions.
There's a service doing this called Converser, if you're still looking.