# How do I get all posts from a specific category?

**URL:** https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589
**Category:** Feature
**Created:** [31 juli 2015 om 01:26 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589 "2015-07-31T01:26:46Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![chenny408](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@chenny408](https://meta.discourse.org/u/chenny408)
#### Post date: [31 juli 2015 om 01:26 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/1 "2015-07-31T01:26:46Z")

</div>

Is there a way to get all the posts from a certain category by a specific user?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [31 juli 2015 om 01:27 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/2 "2015-07-31T01:27:55Z")

</div>

Something like this?  
[https://meta.discourse.org/search?q=category%3Abug%20user%3Acpradio](https://meta.discourse.org/search?q=category%3Abug%20user%3Acpradio)

---

<div class="post-metadata">

### Author: ![chenny408](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@chenny408](https://meta.discourse.org/u/chenny408)
#### Post date: [3 augustus 2015 om 18:59 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/3 "2015-08-03T18:59:18Z")

</div>

i didnt see it in any of the posts.. is there a specific URL i can query?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [3 augustus 2015 om 19:03 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/4 "2015-08-03T19:03:39Z")

</div>

Don’t look at the results, look at the URL and how it is querying for a category and a specific user.

---

<div class="post-metadata">

### Author: ![chenny408](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@chenny408](https://meta.discourse.org/u/chenny408)
#### Post date: [3 augustus 2015 om 20:45 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/5 "2015-08-03T20:45:51Z")

</div>

thanks got it, is there any way to get the raw data? i saw a search() function in the API, but not sure how to include the parameters.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [3 augustus 2015 om 21:32 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/6 "2015-08-03T21:32:27Z")

</div>

> [@Reverse engineer the Discourse API](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576):
>
> Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api. The API is documented at [docs.discourse.org](https://docs.discourse.org). You can also use the [discourse\_api](https://github.com/discourse/discourse_api) Ruby gem as a client library. However, not every endpoint is documented. To determine how to do something with the JSON API here are some steps you can follow. Example: recategorize a topic. Go to a topic and start editing a category: Open Chrome dev tools, switch to the Network tab, select …

gives you

[https://meta.discourse.org/search.json?q=category%3Abug+user%3Acpradio](https://meta.discourse.org/search.json?q=category%3Abug+user%3Acpradio)

---

<div class="post-metadata">

### Author: ![chenny408](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@chenny408](https://meta.discourse.org/u/chenny408)
#### Post date: [4 augustus 2015 om 16:35 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/7 "2015-08-04T16:35:04Z")

</div>

awesome thanks.. anyone know how to use the Ruby gem to call this?  
[https://github.com/discourse/discourse\_api](https://github.com/discourse/discourse_api)

I see in the source code, but wasnt able to create the right parameters to successfully retrieve the query results.

```
  # @param term [String] a search term
  # @param options [Hash] A customizable set of options
  # @option options [String] :type_filter Returns results of the specified type.
  # @return [Array] Return results as an array of Hashes.
  def search(term, options={})
    response = get('/search/query', options.merge(term: term))
    response[:body]
  end

```

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [4 augustus 2015 om 16:37 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/8 "2015-08-04T16:37:39Z")

</div>

Sorry, I’m not very keen on Ruby, but it should be as simple as sending a HTTP Get request to [https://meta.discourse.org/search.json?q=category%3Abug+user%3Acpradio](https://meta.discourse.org/search.json?q=category%3Abug+user%3Acpradio) and just replacing the string sent as q=

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [4 augustus 2015 om 17:31 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/9 "2015-08-04T17:31:31Z")

</div>

Looks like it would be `api_object.get('/search', {q: 'category:bug user:cpradio'})`

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [4 december 2025 om 11:36 UTC](https://meta.discourse.org/t/how-do-i-get-all-posts-from-a-specific-category/31589/10 "2025-12-04T11:36:52Z")

</div>


