How to get repository size and LFS file size using rest api?

I need to check the repository size and LFS file size before cloning the repository.

Hi @Nagaraja,
You could use the Forge app described in this article:

:information_source: For your use case, the app also adds the size information in the repository overview for each user to see.

The app also adds a Workspace Settings Menu page with the size of all repositories in a workspace and a download option to export the information in a CSV file, you can disable that if that’s not required.

I’m showing how the app works in this YouTube video.

At this stage we can only show the size of the repository itself, not including the LFS ones as there isn’t an API to retrieve that information.

Hope this helps,
Caterina