Search results embedded in another page

I am creating a sports website with player stats etc, and am using kirby to write and maintain articles that will be written about each player, as well as draft/trade news, and anything else. What I want to do is have my stats page for each player include a div with search results from kirby, that automatically load when the page is loaded.
How can I achieve this?

As an additional question, I am new to Kirby, and have worked out how the search works, based off the tutorial, but what I don’t understand is the actual HTML, in particular the form.
When on the search page, you can type in the search input, click submit, and the page will reload with your search results. but the is no action=’’ or onClick or onSubmit or anything to tell it what to do, so how does it know what to do?

<form>
  <input type="search" name="q" value="<?php echo esc($query) ?>">
  <input type="submit" value="Search">
</form>

It would be better if there was an action attribute. But in the absence of it, the script in the controller of the same page is used to fetch the results.

What do you mean by “search results that are loaded when the page is loaded”. To me that sounds if you just want to dynamically query some results for the player but not really implement a user search?

To view a players statistics, the user selects a player from a list, then clicks submit, which posts form data, and loads the correct information on the next page. I want to use this posted data to do a search with kirby, with the results then loaded on the next page as well. The stats pages are separate from kirby though, and use php. Hopefully that makes a little more sense

Let me get this right: So you want to use the Kirby search to search through content outside of Kirby?

No I only intend to search the Kirby side of the site, I just want to display the results on a page outside of Kirby

Yes, that’s possible, check out this cookbook recipe: https://getkirby.com/docs/cookbook/json
You might also want to have a look at routing and content representations.