# Ordering by category results in http 500

**URL:** <https://ask.openrouteservice.org/t/ordering-by-category-results-in-http-500/3437>\
**Category:** openpoiservice\
**Created:** [December 23, 2021, 5:55pm UTC](https://ask.openrouteservice.org/t/ordering-by-category-results-in-http-500/3437 "2021-12-23T17:55:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/stefan/32/1529_2.png) [@Stefan](https://ask.openrouteservice.org/u/Stefan)\
**Post date:** [December 23, 2021, 5:55pm UTC](https://ask.openrouteservice.org/t/ordering-by-category-results-in-http-500/3437/1 "2021-12-23T17:55:28Z")

</div>

Hi,  
Whenever I try to get a list of POIs, ordered by category, it results in a 500 internal server error. When I use [https://api.openrouteservice.org/pois](https://api.openrouteservice.org/pois) to post the following:  
{“request”: “pois”,“geometry”: {“geojson”: {“type”: “Point”,“coordinates”: [5.058349000000001,52.647953]},“buffer”:1000},“limit”:100,“filters”: {“category\_group\_ids”:[420]},“sortby”:“category”}

which results in  
{“code”:500,“message”:“Internal server error”}

If I comment out the sortby, it works fine. Since this is correct according to the docs, I am assuming this is a bug?

Just now noticed that I should probably round down the coordinates, 6 decimals or more is a little over the top: but it should not cause an HTTP-500 I think.

TIA,  
Stefan

---

<div class="post-metadata">

**Author:** ![jschnell](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jschnell/32/971_2.png) [@jschnell](https://ask.openrouteservice.org/u/jschnell)\
**Post date:** [January 10, 2022, 8:34am UTC](https://ask.openrouteservice.org/t/ordering-by-category-results-in-http-500/3437/2 "2022-01-10T08:34:41Z")

</div>

Hey,

thanks for noticing 🙂  
This does indeed look like a bug ☹ I have submitted [an issue](https://github.com/GIScience/openpoiservice/issues/120) to the respective repository. You can follow the discussion and progress on this over there.

Best regards

---

<div class="post-metadata">

**Author:** ![Stefan](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/stefan/32/1529_2.png) [@Stefan](https://ask.openrouteservice.org/u/Stefan)\
**Post date:** [January 10, 2022, 9:24am UTC](https://ask.openrouteservice.org/t/ordering-by-category-results-in-http-500/3437/3 "2022-01-10T09:24:07Z")

</div>

Thank you!

I noticed it because I was looking for shops in a town, and thought to myself: wow, that is a long list, it would be convenient if I could order that by category - that would save me scrolling.  
My current workaround is to allow a finer selection of shops, and not request the entire category group. And of course I could sort myself on the client side, but that became a bit slow.

Cheers,  
Stefan

---

<div class="post-metadata">

**Author:** ![jschnell](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jschnell/32/971_2.png) [@jschnell](https://ask.openrouteservice.org/u/jschnell)\
**Post date:** [January 18, 2022, 11:28am UTC](https://ask.openrouteservice.org/t/ordering-by-category-results-in-http-500/3437/4 "2022-01-18T11:28:22Z")

</div>

Hey,

a little late, but I wanted to inform you that the bug has been fixed and the fixed version of the openpoiservice is running 🙂

Best regards

---

<div class="post-metadata">

**Author:** ![Stefan](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/stefan/32/1529_2.png) [@Stefan](https://ask.openrouteservice.org/u/Stefan)\
**Post date:** [January 18, 2022, 12:25pm UTC](https://ask.openrouteservice.org/t/ordering-by-category-results-in-http-500/3437/5 "2022-01-18T12:25:22Z")

</div>

Yes! Thank you, that was quick 🙂  
Just did a quick test, and that looks great. Now I can add a header to the list of results using the category, which makes it a little bit easier to navigate the results list if there are a lot of results.

Thank you again! Love it, one more item for which I won’t use that maps-product from that waaay to big search engine monstrosity anymore 😉 😁
