# Multi-domain Search Module API Code Help

**URL:** <https://community.hubspot.com/t/multi-domain-search-module-api-code-help/88134>\
**Category:** CMS Development\
**Created:** [August 23, 2023, 1:26pm UTC](https://community.hubspot.com/t/multi-domain-search-module-api-code-help/88134 "2023-08-23T13:26:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmcmillan99](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tmcmillan99/32/93181_2.png) [@tmcmillan99](https://community.hubspot.com/u/tmcmillan99)\
**Post date:** [August 23, 2023, 1:26pm UTC](https://community.hubspot.com/t/multi-domain-search-module-api-code-help/88134/1 "2023-08-23T13:26:58Z")

</div>

I need to implement a multi-domain search module for a client. As a result, I cloned the Hubspot search-input and search -results modules so that I could update the api url. However, I am not able to get search results with the changes. Can someone review my changes and let me know what I am doing wrong?

**Search-input:**

```auto
/*const SEARCH_URL_BASE = '/_hcms/v3/site-search/search';*/
const SEARCH_URL_BASE = '/contentsearch/v2/search';

```

**Search-result:**

```auto
/*var SEARCH_URL = '/_hcms/search?';*/
var SEARCH_URL = '/contentsearch/v2/search?';

```

Thanks in advance for the assistance.

Terry McMillan

---

<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 25, 2023, 5:09pm UTC](https://community.hubspot.com/t/multi-domain-search-module-api-code-help/88134/2 "2023-08-25T17:09:23Z")

</div>

Hi, @tmcmillan99 👋 Thanks for always bringing the interesting questions. Hey, @stefen @Indra @Anton, do you have any feedback you can share with @tmcmillan99?

From my end, I have a few questions and suggestions to give the community more details:

- Have you tested the v2 Search endpoint in Postman? To verify you get an expected result, outside the module  
`GET /contentsearch/v2/search​`
- Have you opened your browse’s dev console when making a request? To look for JS or other errors?

Consider adding a simple consloe.log() to your code. To help verify:

- The search query is being captured correctly
- The constructed URL is correct
- The API call is successful and returns the expected results

Thank you. — Jaycee

---

<div class="post-metadata">

**Author:** ![tmcmillan99](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tmcmillan99/32/93181_2.png) [@tmcmillan99](https://community.hubspot.com/u/tmcmillan99)\
**Post date:** [August 25, 2023, 5:20pm UTC](https://community.hubspot.com/t/multi-domain-search-module-api-code-help/88134/3 "2023-08-25T17:20:55Z")

</div>

Hey [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)

Thanks for the reply. I was actually able to resolve the issue yesterday and hadn’t had time to update my post with the solution. I successfully tested in Postman then looked at the console for errors. There was an error referencing the portal id. After some testing, the following url did the trick -  
‘[https://api.hubapi.com/contentsearch/v2/search?portalId=XXXXXXX&](https://api.hubapi.com/contentsearch/v2/search?portalId=XXXXXXX&)’

I used it in both modules.

Thanks,

Terry

---

<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 25, 2023, 5:35pm UTC](https://community.hubspot.com/t/multi-domain-search-module-api-code-help/88134/4 "2023-08-25T17:35:13Z")

</div>

Thanks for letting us know. Have a great weekend! — Jaycee
