# Hubspot content search api

**URL:** <https://community.hubspot.com/t/hubspot-content-search-api/115501>\
**Category:** CMS Development\
**Tags:** javascript, html\
**Created:** [August 30, 2024, 7:30am UTC](https://community.hubspot.com/t/hubspot-content-search-api/115501 "2024-08-30T07:30:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BBecker1](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BBecker1](https://community.hubspot.com/u/BBecker1)\
**Post date:** [August 30, 2024, 7:30am UTC](https://community.hubspot.com/t/hubspot-content-search-api/115501/1 "2024-08-30T07:30:59Z")

</div>

Hello, I am currently working on a custom search module. I am using the content search v2 api and make a call like

```lia-code-sample
 getSearchResults = function() {
 var request = new XMLHttpRequest();
 var requestUrl = "https://api.hubapi.com/contentsearch/v2/search?portalId=[PORTAL_ID]&term=" + encodeURIComponent(searchTerm)
 + "&limit=" + encodeURIComponent(TYPEAHEAD_LIMIT)
 + "&" + searchOptions();

```

In the documentation of the api I also se I can use “&tableId=”

But I get 0 results if I try to search by doing this.  
/de/suche?term=&limit=6&language=de&type=SITE\_PAGE&type=LANDING\_PAGE&type=BLOG\_POST&type=LISTING\_PAGE&tableId=4661445  
How does this exaclty work?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [August 30, 2024, 5:55pm UTC](https://community.hubspot.com/t/hubspot-content-search-api/115501/2 "2024-08-30T17:55:10Z")

</div>

Hey, @BBecker1 👋 Can you clarify or give more context to your goal? Are you getting an empty response or error with your first request? What are you expecting to get back in the response? Having more information helps our community members better understand where and if they can help you.

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![BBecker1](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BBecker1](https://community.hubspot.com/u/BBecker1)\
**Post date:** [September 2, 2024, 6:16am UTC](https://community.hubspot.com/t/hubspot-content-search-api/115501/3 "2024-09-02T06:16:25Z")

</div>

[@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)  
I am trying to search my site and get also hubdb resutls back. I am currently getting nothing back because &tableId=4661445 doesn’t do anything this migth be because of my results page but I am not sure.

---

<div class="post-metadata">

**Author:** ![BBecker1](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@BBecker1](https://community.hubspot.com/u/BBecker1)\
**Post date:** [September 2, 2024, 6:34am UTC](https://community.hubspot.com/t/hubspot-content-search-api/115501/4 "2024-09-02T06:34:55Z")

</div>

So I am tring to do this  
[https://api.hubapi.com/hubdb/api/v2/tables/\[hubdb]/rows?portalId=\[portalid]](https://api.hubapi.com/hubdb/api/v2/tables/%5C%5Bhubdb%5D/rows?portalId=%5C%5Bportalid%5D)  
using content search api  
[https://api.hubapi.com/contentsearch/v2/search?portalId=\[portalid]&term=download&tableId=\[hubdb]](https://api.hubapi.com/contentsearch/v2/search?portalId=%5C%5Bportalid%5D&term=download&tableId=%5C%5Bhubdb%5D)
