Ahrefs API v2 will stop working on March 1st, 2024
This documentation is for the legacy version of our API (v2), which has been discontinued. All active API v2 subscriptions will stop working on March 1st, 2024. Existing Integration apps will continue to work as before until further notice, but new submissions are no longer accepted.
To switch from API v2 to v3, please contact our Enterprise team. Read about API v3.
Documentation - pages
Contains the crawled pages. The result is similar to the crawled pages report found in the raw data export in Site Explorer.
Each request to pages costs 1 row.
Each result in the response costs 0.2 rows.
Using 'where' costs 5 rows.
Using 'having' costs 5 rows.
• pages
Column | Type | Where | Having | Description |
---|---|---|---|---|
url | string | + | + | URL of the crawled page. |
ahrefs_rank | int | + | + | URL Rating of the page. |
first_seen | date | + | + | The date Ahrefs' bot first found a backlink to your target website or URL on a given referring page. |
last_visited | date | + | + | Most recent date when the Ahrefs crawler was able to crawl the page. |
http_code | int | + | + | HTTP code that was last returned for the page. |
size | int | + | + | Size of the crawled page, in bytes. |
links_internal | int | + | + | Number of internal links found in the crawled page. |
links_external | int | + | + | Number of external links found in the crawled page. |
encoding | string | + | + | Character encoding of the page, for example "utf8" or "iso-8859-1" (Latin-1). |
title | string | + | + | Title of the crawled page. |
redirect_url | string | + | + | URL where the page redirects to. |
content_encoding | string | + | + | Type of encoding used to compress the page data, for example "gzip" or "deflate". |
Examples
Request
https://apiv2.ahrefs.com?from=pages&target=ahrefs.com&mode=domain&limit=2&output=json
Response
{ "pages":[ { "url":"https://ahrefs.com/", "ahrefs_rank":85, "first_seen":"2013-01-02T09:46:29Z", "last_visited":"2013-11-20T09:46:29Z", "http_code":200, "size":9211, "links_internal":26, "links_external":4, "encoding":"utf8", "title":"Ahrefs Site Explorer & Backlink Checker", "redirect_url":"", "content_encoding":"gzip" }, { "url":"http://ahrefs.com/", "ahrefs_rank":81, "first_seen":"2013-01-03T16:50:51Z", "last_visited":"2013-11-23T16:50:51Z", "http_code":301, "size":20, "links_internal":1, "links_external":0, "encoding":"raw", "title":"", "redirect_url":"https://ahrefs.com/", "content_encoding":"gzip" } ], "stats":{ "pages":26699 } }