Yes, gathering publicly available data on LinkedIn is entirely legal. In 2019, a US-based court ruled that scraping publicly available information on the platform is legal, despite objections from the company.