Content Search API? Oh My!

A walkthrough of HubSpot's Content Search API and how to use it with React. The speaker shows how the API retrieves and ranks results, then demonstrates integrating it into a webpage to display search results dynamically.
Hi everyone. In this video, I would like to demonstrate a functionality that I'm personally really excited about, and that is the HubSpot Content Search API. The Content Search API allows you to pass a term to the API and it's going to give you all the results. So, website pages, blog posts, hub dbros, where that term is being used. But it's also going to determine what is the best result by checking where the term is being used. So if the term is being used in the page title, in the meta description and in different headings, then the API is going to decide that that is probably one of the better results. Now, what we see right here is a website page with a default text block module, but also a search bar. And this search bar is generated by using React. By using React, we can make API calls to the Content Search API and show the results directly on the website page without having to refresh the page. So if I'm going to type a term in my search bar and I press on the Enter button, then this React application is going to make an API call and it's going to give us all the results where this specific term is being used. Now, you see that in our cards we also highlighted the terms that are available. And this is something really cool that the Content Search API does. It's going to give us all the results with the basic content. So we have the page title, we have an excerpt of the content, we of course have a link to that specific page, but it's also going to wrap all the terms in the content that are available with a little spawn that we can use to give it some additional styling. So that is a really nice functionality. Now, if we take a quick look at the API and this is still available in the legacy docs, then you see that you have a lot of options that you can use to fine tune this specific API functionality. You can pass it a search term makes sense, right? You can determine which type of content you want to return. So you could also determine that you only want to return blog posts. You can determine which domain you want to retrieve results from. A really important param that you can pass to. The Content Search API is the language. Because if you have the search functionality on a Dutch page, you do not want to show all the English pages in the results. You can specify where you want to search for, so you can search through the whole page, the title, the description, the HTML, but you can also limit it to a specific property to fine tune your results. And we have a lot of other.










