API External Search Possibilities within CMS


Hi all,

I'm currently migrating clients's website made in Wordpress. They have a search tool for real state, wich is an external API that can be managed from Wordpress, that shows houses via properties, similar to hotels search.


My question is, how can i take this into a HubSpot website? Do i need external servers in order to manipulate the API first? Do i have to create an external portal? The search results are shown like blog posts in Wordpress. So, i'ts possible to be done in HubSpot?

Any help is appreciated!


Hi @Bruno_Amico, is the API endpoint that gets requested able to be accessed from anywhere? As long as the endpoint is secure (HTTPS) you should be able to use AJAX to make the request, and do any sort of custom filtering with JavaScript. Is the endpoint just pulling properties that you currently have on your website? Or are these stored in an external database? If they're stored in a DB, you could use HubDB with the Website Addon, or you could just use our site search module if these properties would all get moved over to a HubSpot hosted domain: https://knowledge.hubspot.com/articles/kcs_article/cos-general/site-search-faq


@Connor_Barley, i´ll be more specific.

The tool is this, https://simplyrets.com/

It's a Wordpress addon that indexes the pages, it's widely used in the real estate market. My question is, does HubSpot have a solution for those cases? I couldn't find a workaround for hubSpot CMS, without having to use Wordpress.

I hope this helps to clarify, and thank you for your aid!


Hi @Bruno_Amico. HubSpot doesn't have this type of tool natively, but again, if that endpoint supports CORS/AJAX requests and is a database, you could house your listings inside simplyRETS, then make some calls on the frontend to pull in the data onto a HubSpot CMS hosted webpage. Otherwise, HubDB is the solution. HubDB would allow you to create listings and create custom sorting filters on your webpage, which seems like the goal you have in mind here.

HubSpot does not have a place for you to manage server side code like this natively though, if this is what you're asking.


Can you please confirm if this is true or false:

There is no way to write some server side code on HubSpot and to get data from an external WebApp/DB
we need to write AJAX call and enable CORS for HubSpot so that it can get the data?


Hi @lewis4u, that all depends on if your external webapp/db accepts ajax/cors. You can certainly write HTTP requests on HubSpot pages. The distinction is that none of our public facing endpoints aside from the Forms endpoints and some GET calls to HubDB allow for ajax/cors requests.


The thing is simple.... and I have tried it now... it seems it works without problem.
I made an AJAX call to fetch data from our API (database) and enabled only our hubspot domain for CORS and I created a hubspot WebPage where I simply populate the table with that data.

So this is completely fine right? I mean I hope I am not breaking some rules of the "game" or something?


No that's completely allowed. No rules broken there :slight_smile: