# Mapillary search image API sorting result

**URL:** <https://forum.mapillary.com/t/mapillary-search-image-api-sorting-result/957>\
**Category:** Community\
**Created:** [April 20, 2017, 10:41pm UTC](https://forum.mapillary.com/t/mapillary-search-image-api-sorting-result/957 "2017-04-20T22:41:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ema](https://avatars.discourse-cdn.com/v4/letter/e/858c86/32.png) [@ema](https://forum.mapillary.com/u/ema)\
**Post date:** [April 20, 2017, 10:41pm UTC](https://forum.mapillary.com/t/mapillary-search-image-api-sorting-result/957/1 "2017-04-20T22:41:22Z")

</div>

Hi,

I’m using the search API to retrieve the images based on lng,lat. I’d like the result json to be sorted, or limit the number of the image response so that only the lookat or the closest image will show up. How to do that?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![katrin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/katrin/32/251_2.png) [@katrin](https://forum.mapillary.com/u/katrin)\
**Post date:** [May 10, 2017, 12:35pm UTC](https://forum.mapillary.com/t/mapillary-search-image-api-sorting-result/957/2 "2017-05-10T12:35:52Z")

</div>

Hi @ema, you should add `&per_page=1` to make only the closest image show up - change the number to 5 for the closest 5 etc.
