This article references the legacy version of our API (v2). Our newest API version (v3) does support keyword search volume data, and was released on Sep. 7, 2022 and is available for Enterprise users.
Please feel free to contact [email protected] for more details.
Ahrefs API mainly provides information relating to Backlinks and not search related information on keywords. Thus metrics like CPC, Search Volume, Total Clicks can't be pulled from our legacy API.
Via Position Metrics, total monthly search traffic, number of keywords, and traffic cost of the target URL can be checked- https://ahrefs.com/api/documentation/positions-metrics.