How to generate similar youtube tags using user input using Javascript?

I’m trying to build a tool to generate youtube tags by reading the user input using javascript. Somewhat like rapidtags.

Based on my observation of the above-linked tool:

  1. It is fetching similar tags from somewhere instead of hard-coding or by making the tags syntactically.
  2. It’s not only making the tags from strings containing in my(user) input rather it’s also adding other substrings into it.

example if I type “web development” into it its generating tags like “web development 2023”, “full stack web development”, “career in web development” etc.

How do I add/fetch these additions strings?

I’m kind of new to JS and couldn’t find any resource on the Internet which can help me to understand the underlying code.

Wanting Expert suggestions on how can I start building this?