# Discourses API get just the number of search results

**URL:** <https://meta.discourse.org/t/discourses-api-get-just-the-number-of-search-results/76548>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [2017 年12 月 21 日 10:18 UTC](https://meta.discourse.org/t/discourses-api-get-just-the-number-of-search-results/76548 "2017-12-21T10:18:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
发布日期： [2017 年12 月 21 日 15:44 UTC](https://meta.discourse.org/t/discourses-api-get-just-the-number-of-search-results/76548/2 "2017-12-21T15:44:28Z")

</div>

I don’t think we return a “count” in the response, but it is something you can calculate yourself.

See the [search API docs](http://docs.discourse.org/#tag/Search%2Fpaths%2F~1search~1query%2Fget) for a more detailed response example, but it will look something like this:

```plaintext
{
    "posts": [],
    "topics": [],
    "users": [],
    "categories": [],
    "grouped_search_result": {}
}

```

Be default the API will return a max of 50 results. To calculate the count you need to just count the number of items in the posts array. The number items in the topics array should be the same so there is no reason to count that array too.

---

_[View the full topic](https://meta.discourse.org/t/discourses-api-get-just-the-number-of-search-results/76548)._
