# API Blog listing based on tag

**URL:** <https://community.hubspot.com/t/api-blog-listing-based-on-tag/9518>\
**Category:** CMS Development\
**Created:** [July 19, 2018, 9:02am UTC](https://community.hubspot.com/t/api-blog-listing-based-on-tag/9518 "2018-07-19T09:02:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matteo](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/matteo/32/32521_2.png) [@matteo](https://community.hubspot.com/u/matteo)\
**Post date:** [July 19, 2018, 9:02am UTC](https://community.hubspot.com/t/api-blog-listing-based-on-tag/9518/1 "2018-07-19T09:02:52Z")

</div>

Hi everyone,

we are implelenting a blog stream in a client’s website therefore we are using API cURL call

`https://api.hubapi.com/content/api/v2/blog-posts?hapikey=demo&updated__gt=1430452800000&content_group_id=351076`

we are facing an issue: blog post have been tagged with several tags, such as News, Events or other marketing tags.

what we are trying to make out is if there’s a way to list ONLY posts tagged with specific single keyword such as NEWS.

thank you!

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [July 19, 2018, 12:07pm UTC](https://community.hubspot.com/t/api-blog-listing-based-on-tag/9518/2 "2018-07-19T12:07:25Z")

</div>

@matteo - Unfortuanately, you cannot query the API with a blog topic name. However, you can use the[topics api endpoint](https://developers.hubspot.com/docs/methods/blog/v3/list-blog-topics) to get the topics that you need to query, which will get the relative ID to that topic. Then, you can pass a parameter of **topic\_id=** to your blog post listing API call.

example:

[https://api.hubapi.com/content/api/v2/blog-posts?hapikey=demo&topic\_id=53100784](https://api.hubapi.com/content/api/v2/blog-posts?hapikey=demo&topic_id=53100784)

* * *

If this answer helped, please, mark as solved 😄

* * *

[tim@belch.io](mailto:tim@belch.io) | [forms.belch.io](https://forms.belch.io) | Design your own Beautiful HubSpot Forms; No coding necessary.

Drop by and say Hi to me [on slack](http://slack.belch.io/).

---

<div class="post-metadata">

**Author:** ![MFall13](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mfall13/32/10691_2.png) [@MFall13](https://community.hubspot.com/u/MFall13)\
**Post date:** [July 17, 2020, 3:26am UTC](https://community.hubspot.com/t/api-blog-listing-based-on-tag/9518/3 "2020-07-17T03:26:26Z")

</div>

@tjoyce is it possible to pass multiple topic id values to the same topic\_id query parameter?

Something like &topic\_id=xxxxxxxx&xxxxxxxx OR &topic\_id=xxxxxxxx&topic\_id=xxxxxxxx ?

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [July 17, 2020, 6:25am UTC](https://community.hubspot.com/t/api-blog-listing-based-on-tag/9518/4 "2020-07-17T06:25:23Z")

</div>

Hi @MFall13 - I have not tried to search multiple topics before but perhaps the double underscore query might be something you can explore… Something like

`&topic_ids__in=10945,28906`

However, I suspect something like this might return only posts that appear in both topics… might need some guess work done around this

```auto
Optional query string filters & options
Some parameters support "range" filters via double-underscored param suffixes, like '__gt'. If a parameter supports a filter type of 'gt', that means you can append a double-underscore and 'gt' to the parameter name to find all items greater than a specified value.

For example, the following query will find all items with the 'updated' time greater than 1364424600000: https://api.hubapi.com/blogs/v3/topics?hapikey=demo&created__gt=1364424600000

```

---

<div class="post-metadata">

**Author:** ![MFall13](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mfall13/32/10691_2.png) [@MFall13](https://community.hubspot.com/u/MFall13)\
**Post date:** [July 19, 2020, 2:14pm UTC](https://community.hubspot.com/t/api-blog-listing-based-on-tag/9518/5 "2020-07-19T14:14:57Z")

</div>

@tjoyce thanks for the suggestion. I feel like I’ve tried every value filter combo out there.

`&topic_ids__in=30111149151,32404273845" (and &topic_id__in too)`

returns

`Invalid query Filtering by \"topic_id(s) in\" is not allowed`

… another try with the following exact params:

`&topic_id=30111149151&topic_id=32404273845`

responds with a valid request, but only pulls in blogs with the first topic id

…and another try with the suffix ‘\_\_contains’ to no avail.

Any other suggestions? Much appreciated!
