How do I figure out how many calls I have left?

I want to programatically track how close my script is to the APIs daily call limit. In other words if I can make 100k calls per day, is there an endpoint I can query to understand how close I am to that 100k? My script keeps failing by exceeding the daily limit.

Given that each API request can be multiple calls, tracking this on my side is inefficient.

You can use the User API to track your API usage. Additionally, if your daily limit is not sufficient, you can either increase it or purchase extra calls directly from your account dashboard.