Is it my imagination (scratch that, it's definitely not), or does simply browsing method doc pages (without using the "Run" function) consume quota?
From Bash using httpie
and jq
(on a private, non-shared IP):
$ http "https://api.stackexchange.com/2.3/questions?fromdate=1648771200&order=asc&sort=creation&site=askubuntu&pagesize=100&page=1" | jq ".quota_remaining"
164
# Repeat again
$ http "https://api.stackexchange.com/2.3/questions?fromdate=1648771200&order=asc&sort=creation&site=askubuntu&pagesize=100&page=1" | jq ".quota_remaining"
163
Go browse the /answers method doc in the browser. Then /answers/{ids}.
Then, again:
$ http "https://api.stackexchange.com/2.3/questions?fromdate=1648771200&order=asc&sort=creation&site=askubuntu&pagesize=100&page=1" | jq ".quota_remaining"
154
Each doc (method) page hit seems to consume 4 quota units.
On the other hand, pages like Write Access do not drain quota.
This appears to be because the "Try it" on each method page makes a call to /sites
to retrieve the list of possible SE sites, whether or not the "Try it" feature is even used.
Is this expected? I didn't find anything here with the following searches:
Sure, 4 per page isn't much if you've registered for a key and have upped the quota to 10,000, but for new users starting out browsing the doc (an obvious first step), the unkeyed 300 quota limit can be rather quickly run down just browsing the doc.
Should this be considered a "bug"? Could/should it be fixed either by:
An easy, low-hanging change to "Try it" to retrieve 1000 sites at a time to reduce this to single API call? (As @Glorfindel points out in the comments,
/sites
already allows a pagesize of 1000 anyway, but "Try it" only retrieves 100 at a time.(The real fix, I believe) Having "Try it" not populate the Site list until the user attempts to "Edit"/change the default site from Stack Overflow to something else (if they even need to)
Not subtract
/sites
calls from the unkeyed quota? (from @Glorfindel comment below)(Fallback) Exempting
/sites
from the quota? This shouldn't be an issue, since it's normally going to be a rather rare call, I would think, for most apps. And existing 30 calls/second limits should still be in place.
/sites
already has a page size exception: withhttps://api.stackexchange.com/2.3/sites?pageSize=1000
you'll get all sites at once.