legacy-api-documentation icon indicating copy to clipboard operation
legacy-api-documentation copied to clipboard

Endpoint request: photos by ids

Open AAverin opened this issue 7 years ago • 0 comments

Hi guys. In my app that uses 500px API I have a "local favorites" feature – people can mark any picture favorite, then I cache photoId. The tricky part comes when I need to display user's favorites. For every photoId I have to make a network request to https://github.com/500px/api-documentation/blob/master/endpoints/photo/GET_photos_id.md It's not only difficult to implement, although I managed, It also results in a significant number of network requests sent by the app. In API terms it says that we shouldn't use unreasonable amount of bandwidth. This kind of bandwidth looks pretty unreasonable to me.

Would it be possible to have a new endpoint in the API? GET_photos_ids, that would accept list of photo ids, separated via ,, and return back the same response https://github.com/500px/api-documentation/blob/master/endpoints/photo/GET_photos_search.md is returning, but with photos, listed in the query parameter.

I don't know technical details on your side, but it looks like a single database query that should be much faster then doing 10 separate queries for every request. With such endpoint my app will generate much less requests then it does now.

Thanks

AAverin avatar Apr 25 '17 18:04 AAverin