# API response limit in json

**URL:** https://community.graylog.org/t/api-response-limit-in-json/4625
**Category:** Graylog Central (peer support)
**Created:** [March 19, 2018, 10:40am UTC](https://community.graylog.org/t/api-response-limit-in-json/4625 "2018-03-19T10:40:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![FelixFV](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/felixfv/32/1164_2.png) [@FelixFV](https://community.graylog.org/u/FelixFV)
#### Post date: [March 19, 2018, 10:40am UTC](https://community.graylog.org/t/api-response-limit-in-json/4625/1 "2018-03-19T10:40:51Z")

</div>

Hi!  
I have similar problem as in

> [@JSON Results limited for 150 results per query](https://community.graylog.org/t/json-results-limited-for-150-results-per-query/3534):
>
> Hi, We’re using Graylog 2.2.2 and when I try to query the search/universal/relative rest API in a JSON format, I get “total\_results”:11090 but the messages array contains only 150 entries. I didn’t find anything in the documentation limiting results for only 150 entries but in the REST API browser, the ‘Response Content Type’ I can select is only ‘text/csv’ This is the full command I’m using: curl -u USER:PASS -H ‘Accept: application/json’ -X GET http://GRAYLOG\_SERVER\_ADDRESS/api/search/univ…

But my version of graylog is newest stabile

I have 2 nodes with 2.4.3 version:  
Node ID:  
a79139b1-eb44-4fd4-b028-3bb2022fe4fa  
Version:  
2.4.3+2c41897, codename Wildwuchs  
and  
Node ID:  
9d619de9-d9a1-40d5-a2f2-21d0866ebc19  
Version:  
2.4.3+2c41897, codename Wildwuchs

for resolve json limit I have upgrade graylog today.  
But in json response i get:  
message[‘total\_results’] = 988 (as example)  
and length of messages array = 150 (with any relative timerange)

What I can do with this?

---

<div class="post-metadata">

### Author: ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)
#### Post date: [March 19, 2018, 10:48am UTC](https://community.graylog.org/t/api-response-limit-in-json/4625/2 "2018-03-19T10:48:22Z")

</div>

Please provide some details about what requests you’re sending to the Graylog REST API, the responses to these requests, and some details what you’re trying to achieve.

---

<div class="post-metadata">

### Author: ![FelixFV](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/felixfv/32/1164_2.png) [@FelixFV](https://community.graylog.org/u/FelixFV)
#### Post date: [March 19, 2018, 10:53am UTC](https://community.graylog.org/t/api-response-limit-in-json/4625/3 "2018-03-19T10:53:19Z")

</div>

my python request is:  
query = ‘streams:000000000000000000000001’  
fields = ‘\_id,dest\_ip’  
range = str(30)  
url=‘[http://10.124.128.12:9000/api/search/universal/relative?query=’+query+’&range=’+range+’&fields=’+fields+’&decorate=true](http://10.124.128.12:9000/api/search/universal/relative?query='+query+'&range='+range+'&fields='+fields+'&decorate=true)’

in my case I need some aggregation actions in script. An d it needs lot of message in response.

If it is not possible - I’ll try another way

---

<div class="post-metadata">

### Author: ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)
#### Post date: [March 19, 2018, 11:59am UTC](https://community.graylog.org/t/api-response-limit-in-json/4625/4 "2018-03-19T11:59:42Z")

</div>

The default page size is 150 items. If you want more result items, you’ll have to set the `limit` query parameter accordingly or page through the result set (see `offset` query parameter).

> <https://github.com/Graylog2/graylog2-server/blob/2.4.3/graylog2-server/src/main/java/org/graylog2/indexer/searches/SearchesConfig.java#L31>

---

<div class="post-metadata">

### Author: ![FelixFV](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/felixfv/32/1164_2.png) [@FelixFV](https://community.graylog.org/u/FelixFV)
#### Post date: [March 19, 2018, 12:43pm UTC](https://community.graylog.org/t/api-response-limit-in-json/4625/5 "2018-03-19T12:43:14Z")

</div>

I add &limit=some-int to my URL and it works  
thanks @jochen!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [April 2, 2018, 12:43pm UTC](https://community.graylog.org/t/api-response-limit-in-json/4625/6 "2018-04-02T12:43:22Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
