Limiting rows

API Discussion
Is it possible to limit rows with the api by setting some parameter after the request ?

Thanks,

David
There isn't really a concept of rows in the APIs (at least in the endpoints I've used). What end-point are you talking about and what are you looking to limit exactly?
If I am getting the leaderboards data (PVP endpoint) it's quite huge.
I want to limit the number of rows returned because I only need like 15-20.

URL :

https://eu.api.battle.net/wow/leaderboard/2v2?locale=en_US&apikey=XXX
The API docs don't have a way of doing this so you'll need to process this on the server before passing the limited rows to the client.

Assuming PHP you could do this quite easily
/* $data being the json_decode()'d API response */
$top = array_slice($data['rows'], 0, 20);
Hmmmm is this also possible in Java ?
'fraid I don't know Java but a quick Google for an equivalent to PHP's array_slice came back with this: http://stackoverflow.com/a/4654570

Hope it helps!
I posted this today . https://stackoverflow.com/questions/28006416/android-json-limiting-rows. Limiting is only possible when I get back the result I guess. But thanks for your time :) !
Ah right, this being an app changes the context of the answer a little but the answer to the issue is still correct. You can't limit an HTTP response so the app would handle slicing the part of the array you want to use.

Join the Conversation

Return to Forum