Description Usage Arguments Details Value Source See Also Examples
View source: R/rah_linked_domains_by_type.R
Export the external domains that the target has links to.
1 2 3 4 | rah_linked_domains_by_type(target,
token = Sys.getenv("AHREFS_AUTH_TOKEN"), mode = "domain",
metrics = NULL, limit = 1000, order_by = NULL, where = NULL,
having = NULL)
|
target |
character string. Aim of a request: a domain, a directory or a URL |
token |
character string. Authentication token. Should be available through enviromental variables
after authentication with function |
mode |
character string. Mode of operation: exact, domain, subdomains or prefix. See more in Details section |
metrics |
character vector of columns to select. See more in Details section |
limit |
integer. Number of results to return |
order_by |
character vector of columns to sort on. See more in Details section |
where |
character string - a condition created by |
having |
character string - a condition created by |
1. available metrics - you can select which columns (metrics) you want to download and which one
would be useful in filtering, BUT not all of them can always be used in "where"
&
"having"
conditions:
Column | Type | Where | Having | Description |
domain_from | string | + | + | Target of the request. |
domain_to | string | + | + | Root of external domain that has links from the target. |
links | int | - | + | Number of external links from the target that link to the external domain. |
all | int | - | + | Number of external links from the target that link to the external domain. |
text | int | - | + | Number of text external links from the target. |
image | int | - | + | Number of image external links from the target. |
nofollow | int | - | + | Number of NoFollow external links from the target. |
dofollow | int | - | + | Number of DoFollow external links from the target. |
redirect | int | - | + | Number of redirection external links from the target. |
canonical | int | - | + | Number of canonical external links from the target. |
gov | int | - | + | Number of external links from the target to governmental domain. |
edu | int | - | + | Number of external links from the target to educational domain. |
rss | int | - | + | Number of RSS external links from the target. |
alternate | int | - | + | Number of alternate external links from the target. |
first_seen | date | + | + | Least recent date when the Ahrefs crawler was able to see the link on the target. |
last_visited | date | + | + | Most recent date when the Ahrefs crawler was able to see the link on the target. |
domain_to_rating | int | - | + | Domain Rating of the external domain. |
domain_to_ahrefs_top | int | - | + | Ahrefs rank of the external domain. |
2. "mode"
parameter can take 4 different values that will affect how the results will be grouped.
Example of URL directory with folder:
Example URL: ahrefs.com/api/
exact: ahrefs.com/api/
domain: ahrefs.com/*
subdomains: *ahrefs.com/*
prefix: ahrefs.com/api/*
Example of URL directory with subdomain:
Example URL: apiv2.ahrefs.com
exact: apiv2.ahrefs.com/
domain: apiv2.ahrefs.com/*
subdomains: *apiv2.ahrefs.com/*
prefix: apiv2.ahrefs.com/*
3. "order_by"
parameter is a character string that forces sorting of the results. Structure:
Structure: "column_name
:asc|desc"
Single column example: "first_seen:asc" ~ this sorts results by first_seen
column in ascending order
Multi column example: "last_seen:desc,first_seen:asc" ~ this sorts results
by 1) last_seen
column in descending order, and next by 2) first_seen
column in
ascending order
4. "where"
& "having"
are EXPERIMENTAL parameters of condition sets
(character strings) that control filtering the results. To create arguments:
use rah_condition()
function to create a single condition, for example:
cond_1 <- rah_condition(column_name = "links", operator = "GREATER_THAN", value = "10")
use rah_condition_set()
function to group single conditions into final condition
string, for example: fin_cond <- rah_condition_set(cond_1, cond_2)
provide final condition to proper report function as a parameter, for example:
RAhrefs::rah_linked_domains_by_type(target = "ahrefs.com", token = "0123456789",
mode = "domain", metrics = NULL, limit = 1000, where = fin_cond, order_by = "first_seen:asc")
data frame
https://ahrefs.com/api/documentation
Other Ahrefs reports: rah_ahrefs_rank
,
rah_anchors_refdomains
,
rah_anchors
,
rah_backlinks_new_lost_counters
,
rah_backlinks_new_lost
,
rah_backlinks_one_per_domain
,
rah_backlinks
,
rah_broken_backlinks
,
rah_broken_links
,
rah_domain_rating
,
rah_linked_anchors
,
rah_linked_domains
,
rah_metrics_extended
,
rah_metrics
,
rah_pages_extended
,
rah_pages_info
, rah_pages
,
rah_refdomains_by_type
,
rah_refdomains_new_lost_counters
,
rah_refdomains_new_lost
,
rah_refdomains
, rah_refips
,
rah_subscription_info
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# creating single conditions for 'having' parameter
cond_1 <- RAhrefs::rah_condition(
column_name = "all",
operator = "GREATER_OR_EQUAL",
value = "10")
cond_2 <- RAhrefs::rah_condition(
column_name = "unique_pages",
operator = "GREATER_OR_EQUAL",
value = "6")
# joining conditions into one condition set
cond_having <- RAhrefs::rah_condition_set(cond_1, cond_2)
# downloading
b <- RAhrefs::rah_linked_domains_by_type(
target = "ahrefs.com",
limit = 2,
having = cond_having,
order_by = "ahrefs_rank:desc")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.