To restrict autocomplete elements to specific types, please use OSM class/ type to restrict, entered with the tag parameter.

Example: For a city, OSM class is "place" & OSM type is "city". To restrict by city, we have to use tag=place:city

Example: For all types of a OSM class, OSM class is "place" & OSM type is everything under place.

To restrict the results to all elements under a particular class, we have to use tag=place:

You can also use 'countrycodes' parameter if you are looking only to geocode within a particular country.