question

brendan avatar image
brendan asked

API call limits

Brendan Vanous
started a topic on Sat, 23 May 2015 at 1:10 PM

Question from a developer:

I see there's an indicator for total API calls per day on the dashboard.

Does this affect billing in any way?

The indicator shows a limit of 100,000 calls per day. Once we move to one of the non-test tiers, does this limit go away?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Sun, 24 May 2015 at 4:59 PM

True - and I should have done that this time. I'll pull the answer down along with the info on your question and mark this one, for easy reference.

Main answer:

We bill based upon DAU for our service's API calls, not on the number of calls made. So no, the total API calls does not affect billing.

The limit of 100,000 calls per day is for while your game is in test. This helps to ensure that if you have a bug which causes an excessive number of calls, this won't cause a massive spike in your titles usage of our service. The limit goes away when your title is moved to the appropriate billing tier for release. However, it's worth noting that you do need to ensure that your title isn't making an excessive number of calls, as that wouldn't be sustainable (hence, the reason we call this out in our Terms of Service). A good way to think of this is that if your game is making an average (across all gameplay) of a few calls per minute, you shouldn't run into any issues. Brief bursts of several calls at key points are common, but they average out over time.

Follow-up:

API calls are calculated on a per-title basis.

The average calls in this refers to calls per client (player). We do not limit the API calls per minute across all users, as that would limit the number of users you could have in the game at any one time.


4 Comments
johntube said on Sun, 24 May 2015 at 4:31 PM

@Brendan : Usually you post the answer separately and mark it as answered !

My question is about how API calls are calculated : per Title ? per Publisher ? per "AdminId" (the PlayFabId of the owner of the Title) ?

And when you say : "an average (across all gameplay) of a few calls per minute" do you mean few calls per minute PER USER or PER TITLE ? I mean the tolerated AVERAGE number of API calls for a Title X is few (<10 ? <100) per MINUTE for all Users of that Title or for each User of that Title ?


Brendan Vanous said on Sun, 24 May 2015 at 4:59 PM

True - and I should have done that this time. I'll pull the answer down along with the info on your question and mark this one, for easy reference.

Main answer:

We bill based upon DAU for our service's API calls, not on the number of calls made. So no, the total API calls does not affect billing.

The limit of 100,000 calls per day is for while your game is in test. This helps to ensure that if you have a bug which causes an excessive number of calls, this won't cause a massive spike in your titles usage of our service. The limit goes away when your title is moved to the appropriate billing tier for release. However, it's worth noting that you do need to ensure that your title isn't making an excessive number of calls, as that wouldn't be sustainable (hence, the reason we call this out in our Terms of Service). A good way to think of this is that if your game is making an average (across all gameplay) of a few calls per minute, you shouldn't run into any issues. Brief bursts of several calls at key points are common, but they average out over time.

Follow-up:

API calls are calculated on a per-title basis.

The average calls in this refers to calls per client (player). We do not limit the API calls per minute across all users, as that would limit the number of users you could have in the game at any one time.


johntube said on Sun, 24 May 2015 at 5:07 PM

That's good !

But the GameManager can't give insights about API calls per client (player, user) ! At least the clients with the highest number of API calls !


Brendan Vanous said on Sun, 24 May 2015 at 5:57 PM

True, but you should be able to estimate usage for clients based upon your game's logic, and good testing should provide some solid numbers on specific behaviors. The best plan is to always go with the "worst case" when estimating, and then optimize the game based on that. Still, I can also see a need for a "top API users" report, similar to the "top spenders", so that you can look for any aberrant behavior (and check the events for those users). I'll add that to the backlog.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Martin L avatar image
Martin L answered

In looking at the current limits page there is no longer any mention of the number of API call made per cloudscript handler function. It used to be be 10. Is this limit deprecated?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

Yes and no. When using Cloud Script, it's important to bear in mind that a) you have a limited amount of CPU time to work with, and b) all Server API calls are Web API requests from the logic server running the Cloud Script to PlayFab. Granted, the servers talking to each other are in the same Availability Zone, but that's still an external call (all of PlayFab can't run on a single server, after all). So when designing your Cloud Script handlers, you should be careful to only use a small number of Server API calls, in order to minimize the risk of hitting your CPU limit (which causes the script to halt and exit). If the calls require looking up and/or returning a large amount of data (very large inventories, many data keys or keys with very large values), they'll take more time, but a good rule of thumb to start with is to keep it down to one call per available CPU second. From there, you should do thorough testing using your worst-case-scenario maxes for data.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.