This article references the legacy version of our API (v2). Our newest API version (v3) was released on Sep. 7, 2022 and is available for Enterprise users.
Please feel free to contact support@ahrefs.com for more details.
Your API consumption is charged by rows of data of returned results. The number of credits you can use for queries with our API per month is determined by your API subscription level:
Each request consumes one row + number of results * price of each result. For price of each result, please look it up in documentation for each function.
Most of requests will cost one row for the request itself + number of rows of returned results for the said request.
For example: your request returns 1,000 referring domains when you are working with 'refdomains' API call - https://ahrefs.com/api/documentation/refdomains
The total number of rows consumed will be:
1 row (the price of the request itself) + 1 row (the price of 1 result returned) * 1,000 (number of results returned) = 1,001 rows
Do note that "Each result" means not each specific object of the API response, but the whole response returned for the target domain/URL you request the data for.
Related:
Video tutorial: