(Search that page for "Rate Limiting" for the relevant section) Spotify rate limits API requests in a vague way. Spotify for their playback state every 5 seconds. When a spotify user registers with listen along, we are polling Processing data in guaranteed-to-work batch updates is better than an app which stops functioning entirely due to rate limiting, and you can make it clear to your users that updates to their Last.fm profile will not be immediate. Of course, you sacrifice a feeling of realtime processing, but when you don't have access to realtime APIs there's not much you can do about it. Play history objects from the web API include a timestamp which you can pass directly on when scrobbling, so the user's Last.fm profile will reflect accurate listening times. With 400 users, this would work out at one request every 3.6 seconds, which I'm sure wouldn't trigger Spotify's rate limiting policy. Thus, it follows that you could safely limit your requests to once every 24 minutes per user without missing anything. A track must be played for at least 30 seconds to be included in the playback history, and you can fetch up to 50 recently played items. Requesting a users recently played tracks once per minute seems unnecessary for your use case.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |