Video: Create a Search Module on your Site with Content Search API
5200728118
Created By:
Upvote
Created By:
Show Full Video Translation
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 post Hopi bureaus 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 a method 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, uh, an, an excerpt of the content. We of course have a link to that specific page. But's also going to wrap all the terms in content that are available with a little spa that we can use to give it some additional styling. So that is, that is 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 at the search term. Make sense, right? Um, you can determine which type of content you want to return. So you could also determine that you only want to return block posts. Um, you can determine which domain you want to retrieve results from. A really important program that you can pass to the, uh, content search API is the language because if you have the, uh, search functionality on a Dutch page, you do not want to show all the English pages in the results. You can, uh, specify, uh, where you want to search for. So you can search through the whole page, the title of 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 different options that we could use. Now what we did is in our module, we added a few settings that is going to allow us to fine tune results based on where this module is being used.
So we could use this on a block page to only return results from a specific block by checking these check boxes and specifying a language or even specifying a path prefix. And this is really nice functionality because you can also limit the results based on the pop prefix. So if you only want results for a knowledge center and you have knowledge center in your sl, you can add a prop pop prefix to limit those results. You can fine tune this search functionality to only show the content that is relevant for the page that this module is on. Now, if we take a look at the code, you'll see that we're going to make a call to the Content Search api, and this is currently the fee two version of the api. Um, the first thing we're doing is we're passing it a portal id. Then we're passing it the search term, and that is the, uh, value that is being bossed.
In the little search form that we have on our page, we're going to pass the language if it's set. So we have a check if it's set, we're going to pass the limit, which is also available in the settings of this specific module. But you can use that and, and implement that anyway you want. Um, we're going to use an offset because on this specific page we have a low more button to limit the results, um, and only show the most relevant cards based on the search term. We have, um, uh, the, uh, type limits implemented. So if someone selected pages and block in, uh, this specific module, we're only going to retrieve site pages and block posts, and in this case also the listing page. But we also include knowledge articles and landing pages. Um, and we have the option to implement multiple Bob prefixes to also decrease the results available based on these settings. Um, now if we take a quick look at the code of the React application, you'll see that we have a basic state and then we have a fetch post functionality. And this fetch post functionality is going to be called each time someone is passing a term on the website. Um, and we're passing it all the options that are set in this specific module. So that's going to fine tune the AP API call.
And by allowing the user to set these options through the module, they can use this functionality on different pages with different results. So this API allows you to create a module, um, or a marker application on your website page, um, where the user can search through your whole website, but you can also limit the functionality to only search for specific content. So this is a great addition to your HubSpot website. Thanks for watching. And if you want to learn more about cool functionalities about hotspot, the api, the CRM or cms, make sure to follow me or Bright Digital. Have a great day.
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, uh, an, an excerpt of the content. We of course have a link to that specific page. But's also going to wrap all the terms in content that are available with a little spa that we can use to give it some additional styling. So that is, that is 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 at the search term. Make sense, right? Um, you can determine which type of content you want to return. So you could also determine that you only want to return block posts. Um, you can determine which domain you want to retrieve results from. A really important program that you can pass to the, uh, content search API is the language because if you have the, uh, search functionality on a Dutch page, you do not want to show all the English pages in the results. You can, uh, specify, uh, where you want to search for. So you can search through the whole page, the title of 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 different options that we could use. Now what we did is in our module, we added a few settings that is going to allow us to fine tune results based on where this module is being used.
So we could use this on a block page to only return results from a specific block by checking these check boxes and specifying a language or even specifying a path prefix. And this is really nice functionality because you can also limit the results based on the pop prefix. So if you only want results for a knowledge center and you have knowledge center in your sl, you can add a prop pop prefix to limit those results. You can fine tune this search functionality to only show the content that is relevant for the page that this module is on. Now, if we take a look at the code, you'll see that we're going to make a call to the Content Search api, and this is currently the fee two version of the api. Um, the first thing we're doing is we're passing it a portal id. Then we're passing it the search term, and that is the, uh, value that is being bossed.
In the little search form that we have on our page, we're going to pass the language if it's set. So we have a check if it's set, we're going to pass the limit, which is also available in the settings of this specific module. But you can use that and, and implement that anyway you want. Um, we're going to use an offset because on this specific page we have a low more button to limit the results, um, and only show the most relevant cards based on the search term. We have, um, uh, the, uh, type limits implemented. So if someone selected pages and block in, uh, this specific module, we're only going to retrieve site pages and block posts, and in this case also the listing page. But we also include knowledge articles and landing pages. Um, and we have the option to implement multiple Bob prefixes to also decrease the results available based on these settings. Um, now if we take a quick look at the code of the React application, you'll see that we have a basic state and then we have a fetch post functionality. And this fetch post functionality is going to be called each time someone is passing a term on the website. Um, and we're passing it all the options that are set in this specific module. So that's going to fine tune the AP API call.
And by allowing the user to set these options through the module, they can use this functionality on different pages with different results. So this API allows you to create a module, um, or a marker application on your website page, um, where the user can search through your whole website, but you can also limit the functionality to only search for specific content. So this is a great addition to your HubSpot website. Thanks for watching. And if you want to learn more about cool functionalities about hotspot, the api, the CRM or cms, make sure to follow me or Bright Digital. Have a great day.
One of my favourite hidden gems of the HubSpot API is definitely the content search API.
The content search API allows you to search for a specific term within your website pages, blog posts, HubDB rows, knowledge base articles and landing pages. Not only will it return all the results that use that term, but it's also going to decide the best results based on where the term is being used.
Now, this API has a LOT of options, so you can also fine-tune what results you want to show by passing it several parameters. Some of them are;
β
Limiting results by language
β
Limiting results by path prefix
β
Limiting results by type (blog post, website page etc.)
But you can also determine which type of content should get a higher priority in the results.
In this video, I will show you how we used this API together with React to create a module that allows you to create a search functionality anywhere on your HubSpot website AND fine-tune the results per page this module is used on.
π€ Let me know what your favourite hidden gem is of the HubSpot API.
All my videos will be also posted to my YT channel: @teunrutten
HubSpot Products
Tags
More Builds Like This One
Video: Sales Pipeline Prep for 2023 Part 2
By: Amber Mizelle
π
It's the most wonderful time of the yearπ Prepping for your 2023 HubSpot forecast Part 2! Last week I shared some tips for how to st.
Video: Zapier and OpenAI
By: Ryan Gunn
Now that Zapier is integrated with OpenAI, it opens up a smorgasbord of new possible #hubspottipsandtricks! Here's something I was messi.
Video: Review Company Data Quarterly
By: Ryan Gunn
Do you look at your most important clients on a quarterly basis to see how business is going? You should. Unfortunately, Hubspot doesn't.
Video: A/B test an email in workflows
By: Ryan Gunn
You can easily A/B test an email to try out different subject lines or design elements. But what about testing send cadence of an email .
Video: Use Custom Objects to Surface Contact Info
By: Ryan Gunn
Hubpot's Custom Object tool has limitless use-cases, but one way you can use it is to save your sales team some clicks by surfacing impo.
Video: Use tickets to manage invoicing
By: Amber Mizelle
HubSpot users - How does your Accounting team know when a sales rep just moved a deal to Closed Won and they need to review it for invoi.
Video: Best practices to manage deal close dates
By: Amber Mizelle
Are the deal close dates a mess in your pipeline(s)? Are they inaccurate or has the close date passed, but the deal is still open? HubSp.
Video: Sales Pipeline Prep for 2023 Part 1
By: Amber Mizelle
It's the most wonderful time of the year π β It's time to fill out your HubSpot sales goals and forecasting metrics for 2023 and update.
Video: Chatgpt is Coming
By: Connor Jeffers
#Chatgpt may not take all of our jobs, but its definitely coming after Max Cohen π§π» and Robert Jones. Memes are what it does best.
Video: Remove Properties from Views
By: Amber Mizelle
If you've ever tried to archive a property from a HubSpot portal, you know that you have to remove it from use before it can be archived.
Video: Managing Customer Lifecycle with Multiple Sales
By: Amber Mizelle
Not all B2B companies sell 1 solution or only sell to their clients once, so one of the biggest issues that my B2B clients run into in H.
Video: Calendar View for Scheduling Meetings
By: Kyle Jepson
There's now a calendar view when you schedule meetings inside the CRM. #HubSpotTipsAndTricks
video: Build a Lead Routing Workflow
By: Carsten Brendel
Are you responsible for sales or are you the managing director? Then hopefully you're already using lead routing. If not, here are the e.
video: Why You Should Document Your Builds
ππ»ββοΈ Remember to create naming conventions, descriptions and documentation, kids! Inspired by βs super version of this super meme:
video: Sequence Builder Glow Up
Guess who got a glow-up to start the new year π
πΌ The HubSpot Sequence Builder 𧑠Well, the updates to the interface actually happened .
Video: Export the Full History of a Contact
You can now export the full history of individual contacts #HubSpotTipsAndTricks #HubSpot #CRM
video: Using the Record Overview Tab
By: Moustafa M.
This NEW (somewhat hidden) Hubspot feature can save your team TONS of hours. In our latest #hubspot_powertip we dive into overviews whic.
video: Access Your Marketing Email Analytics in the Custom Report Builder
You can now access your marketing email analytics in the custom report builder! (Also, a surprise shoutout to my friends in #Australia) .
Video: Migrating Blogs with Dynamic Pages
By: Teun Rutten
π Migrating multiple HubSpot Blogs to HubDB with dynamic pages In this video, I'm going to showcase a website we optimized for our fant.
Video: Book Over Calendar Blocks with the Meeting Tool
By: Kyle Jepson
This update to HubSpot will help sales and CS reps book meetings on the spot - so useful!
Video: How to Clone Products
By: Kyle Jepson
You can now clone products #HubSpotTipsAndTricks #HubSpot #CRM #Sales #SalesEnablement
Video: Best Practice for using the Forecast Tool
By: Alex Enache
If 2023 is the year when you want to put more structure in your sales team's processes and truly take forecasting to another level, you .
Video: Manage Updates on Import
By: Kevin van Beers
Running imports in HubSpot just became a little cooler! π When importing records into the CRM, you can now specify that you want to onl.
Video: Audit Properties with Data Quality
By: Amber Mizelle
Creating a new property is pretty simple in HubSpot, but how do you know which ones aren't being used so you can remove them? If you hav.
Video: Apply Presets to Entire Teams
By: Kyle Jepson
You can now apply presets to entire teams! #HubSpotTipsAndTricks #HubSpot #CRM #UserManagement cc
Video: And Filtering in Index Views
By: Kyle Jepson
big update to filtering the Index view in HubSpot - no more making active lists just to have the OR filter option! fantastic update
Video: Our Favorite Integrations
By: Juan Jaimes
Unleash the power of HubSpot with these essential integrations brought to you by Juan Jaimes π Hubspot is an all-in-one marketing, sale.
Video: Filter and Search Meeting Links
You can now filter and search your list of meeting scheduling pages #HubSpotTipsAndTricks cc