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 API.
We've made some progress on this front though, as our API now also gives an estimation of total monthly search traffic, number of keywords, and cost of the target URL - https://ahrefs.com/api/documentation/positions-metrics.

If you would like more of KE available via API in future, do upvote this feature request on https://ahrefs.canny.io/api/p/allow-api-for-keywords-and-search-volume and the team will consider it at an opportune time.

Did this answer your question?