How to get total number of jar package

I want to obtain the total number of jar packages in the Maven repository. I used the API to traverse all the assets in the repository, but the number of assets was too large. Continuously calling the API caused a memory overflow and the server restarted. Is there any way to quickly obtain the total number of jar packages in a maven-repo?

Can anyone help me ?