The legal standard for when police can collect information without a warrant involves the “expectation of privacy” test. If there is an established, constitutional expectation of privacy in a specific context, then sans other mitigating factors, a police officer is required to obtain a search warrant to collect said information. A classic example is something inside a person’s private residence. That is a location that the courts have enshrined as having one of the highest expectations of privacy, and most situations where police search a home without a warrant are going to be given serious legal scrutiny. However one of the most effective means police have at bypassing the expectation of privacy is via consent, if a cop comes and asks to search my house, and I say “sure thing”, I have forfeited my expectation of privacy and most of my Fourth Amendment protections. AKA I’ve done a very, very stupid thing.
Many searches of cars that get people in trouble are actually conducted after the suspect gave consent. Sans consent, a police officer is typically only limited to things in “plain view” during a traffic stop. If they want more than that they will need to find some probable cause and get a warrant to do a search.
So let’s look at the specifics of the OP’s scenario:
Your social media account information. This is actually “information”, you are not required to give any information to police [added] - other than who you are, particularly in a traffic stop you are required to provide identification as to who you are and proof you have a driver’s license, in a street interaction in many states you are required to identify who you are but are not generally required to produce physical identification on the street… In fact information has an even higher bar for police access than “property / personal possessions / private papers”, in that providing information, in many contexts, is considered “providing testimony against yourself”, which you are never required to do under the Fifth Amendment. So there is actually almost no circumstance where you are required to legally tell a police officer what your Facebook ID is or your Twitter handle etc. They can do a lot of things using public resources on the internet, to try and find out, but they cannot make you tell them, in this case even with a search warrant. With a search warrant they could seize your phone, computer etc, and under IT analysis may be able to determine what your social media accounts are, and may even find your passwords in plaintext etc if you’ve stored them that way. However just like the police can ask you “what are you doing?” (that is also information, even with a warrant they can never make you tell them the answer to that question), they can certainly ask for social media information.
As for it being improper. A good century and more of American law has established it as a police procedural norm that police, while making a lawful stop, can ask you various questions. Some of those questions, if you provide answers, can fuck you over really bad legally. That doesn’t make it improper. You can say no. If they haven’t made a lawful stop you don’t even have to stop or respond to their questioning, although that scenario only applies to on the street interactions with police. Police can stop you on the street to briefly ask you questions, but on the street you have much stronger rights to just ignore them or tell them “I don’t answer police questions”, and they have little recourse. Due to the way the road system and traffic laws work, you do not have the right to just drive away from a traffic stop without permission, but they also cannot stop you and hold you forever without cause.
Edited to add a clarifying point about the requirement to provide police identification.