It's easy to burn a big chunk of an Ahrefs API allowance before a script does anything useful. Nothing has to be broken for that to happen. The unit rules just punish small, chatty requests.
If you're about to build on it, here's the short version worth reading before the first loop.
The formula
Ahrefs documents the cost of a request as:
max ( base_cost , per_row_cost * num_rows )
Enter fullscreen mode
Exit fullscreen mode
base_cost is 50 units. per_row_cost is the sum of every unique field that shows up in the result, in where , or in order_by . Most fields cost 1 unit, some cost 5 or 10.
Their own example is the Domain Rating endpoint. It returns one row with two fields, so the row cost is 2. You still pay 50, because 2 is less than the base.
So small lookups are the expensive ones per piece of data.…