It is legal, and the entry threshold is particularly high. Many things done by detective companies are similar to those done by police. If a reconnaissance unit wants to stand on its feet for a long time, they also have long-term contact with various public security and procuratorial organs, and even hire people from them to their units.
Detectives use many special means to investigate their behavior, such as stalking, eavesdropping and candid camera shooting. So from the outside world, this industry is not so good. Actually, this is no longer a problem. Many policemen don't accept or are inconvenient to intervene. They can go out with high fees and credibility. A detective is a person with some expertise.
You need to find a well-known research company, so you don't have to be afraid of any mistakes, and they are all clearly marked. Their way of doing things is absolutely trustworthy and can help you solve practical problems.