Whenever necessary to make an inspection to enforce any of the provisions of the state minimum standard codes, or whenever the city clerk or his designated representative has probable cause to believe that there exists in any building or structure or upon any premises within the city any condition or code violation which makes such building, structure, or premises, unsafe, dangerous or hazardous, the city clerk or his designated representative, may enter such building, structure, or premises, at all reasonable times to inspect the same or to perform any duty imposed by this article; provided, if such building, structure, or premises is occupied, he shall first present proper credentials and request entry from the building's owner or occupant. If such building, structure or premises is unoccupied, he shall first make a reasonable effort to locate the owner or person having charge or control of the building, structure or premises and request entry. If entry is refused, the city clerk or his designated representative may apply to the judge of the municipal court of the city for an administrative search warrant.