# Content Search API v2

**URL:** <https://community.hubspot.com/t/content-search-api-v2/29220>\
**Category:** APIs & Integrations\
**Tags:** cms-content\
**Created:** [December 15, 2020, 8:29pm UTC](https://community.hubspot.com/t/content-search-api-v2/29220 "2020-12-15T20:29:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mucar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mucar/32/53612_2.png) [@mucar](https://community.hubspot.com/u/mucar)\
**Post date:** [December 15, 2020, 8:29pm UTC](https://community.hubspot.com/t/content-search-api-v2/29220/1 "2020-12-15T20:29:01Z")

</div>

Hi,

I’m trying to search posts from our Hubspot-powered blog with the help of [Content Search API v2](https://legacydocs.hubspot.com/docs/methods/content/search-for-content). Found the following call from the documentation, which I’m using as the starting point:

`https://api.hubapi.com/contentsearch/v2/search?portalId=62515&term=hubspot`

In this call I’m replacing the portalId to our Hubspot ID and the term to any term from the blog. In the attached screenshot you can see the response I get in Postman.

Since I’m not getting any result, I believe I’m doing something fundamentally wrong but don’t know what that is. Much appreciated if anyone can point me in the right direction.

Thank you

_p.s. I’m not filtering for blog posts during the testing but when I get this working I’ll add the filter._

 ![35417i940C2655A384F63F.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/c/cc4f98be62e6c8062c174537937658ec70a674c2.jpeg)

---

<div class="post-metadata">

**Author:** ![prosa](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/prosa/32/4387_2.png) [@prosa](https://community.hubspot.com/u/prosa)\
**Post date:** [December 15, 2020, 10:07pm UTC](https://community.hubspot.com/t/content-search-api-v2/29220/2 "2020-12-15T22:07:31Z")

</div>

Please verify your portal ID

---

<div class="post-metadata">

**Author:** ![mucar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mucar/32/53612_2.png) [@mucar](https://community.hubspot.com/u/mucar)\
**Post date:** [December 16, 2020, 12:45pm UTC](https://community.hubspot.com/t/content-search-api-v2/29220/3 "2020-12-16T12:45:43Z")

</div>

Thank you @prosa for the suggestion. The portal ID was correct.

The issue was related to robots.txt for the blog. Added the following to the file and then API started to work.

```lia-code-sample
# Block all bots
User-agent: *
Disallow: /

# Allow HubSpot Site Search Indexing
User-agent: HubSpotContentSearchBot
Allow: /

```

Here’s [the reference from the documentation](https://developers.hubspot.com/docs/cms/features/content-search#control-indexing-during-development) for anyone who faces the same problem.

Thank you

---

<div class="post-metadata">

**Author:** ![JVallejo7](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@JVallejo7](https://community.hubspot.com/u/JVallejo7)\
**Post date:** [May 3, 2022, 10:22am UTC](https://community.hubspot.com/t/content-search-api-v2/29220/4 "2022-05-03T10:22:28Z")

</div>

I have the robots enable like you said but I don’t receive any answer too

 ![JVallejo7_0-1651573283778.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/1/b/1bc044e6833daece867034f3b4d921a3b6ac3107.png)

 ![JVallejo7_1-1651573314507.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/8/c8dceadb4230e1f89d63e36db32bfd1185bd31c2.png)

You can see this test here

[http://hubspot-developers-18iodbe-25237078.hs-sites-eu1.com/blogreformermodificado/emoji-vs.-heroglyphs-a-primitive-from-of-language](http://hubspot-developers-18iodbe-25237078.hs-sites-eu1.com/blogreformermodificado/emoji-vs.-heroglyphs-a-primitive-from-of-language)
