I’m more interested in my actual question. If there is some sort of interoperable API or something, not engaging with hostile glib one liners.
A workaround approach - disregarding any existing standards - would be to simply give the user a random, unique string to search for and then try to detect that string in the URL (typically as a query parameter) - then the browser just has to replace that string with the user's actual search query in subsequent searches.
This is probably how Firefox works, because I get suggested a new search engine every time I search on a new site.