Search ajax using search bar or autocomplete

i want to search from api i don’t find example for search bar using custom search how i can use it ??

and for auto complete when click on word which find it choose i can’t click on word for route to search page…

can you give me example for that ??