data_for_seo/entity/backlinks/element/backlinks.rs
1use serde::{Deserialize, Serialize};
2
3/// A single backlink item returned by the Backlinks endpoint.
4/// See <https://docs.dataforseo.com/v3/backlinks/backlinks/live/>.
5#[derive(Debug, Default, Serialize, Deserialize, Clone)]
6pub struct BacklinksElementBacklink {
7 /// Element type identifier for this item.
8 #[serde(rename = "type")]
9 pub type_of_element: Option<String>,
10 /// Domain the backlink originates from.
11 pub domain_from: Option<String>,
12 /// URL of the page the backlink originates from.
13 pub url_from: Option<String>,
14 /// Whether the `url_from` page uses HTTPS.
15 pub url_from_https: Option<bool>,
16 /// Domain the backlink points to.
17 pub domain_to: Option<String>,
18 /// URL the backlink points to.
19 pub url_to: Option<String>,
20 /// Whether the `url_to` page uses HTTPS.
21 pub url_to_https: Option<bool>,
22 /// Top-level domain of the referring page.
23 pub tld_from: Option<String>,
24 /// Whether the backlink is newly discovered.
25 pub is_new: Option<bool>,
26 /// Whether the backlink has been lost.
27 pub is_lost: Option<bool>,
28 /// Spam score of the backlink (0-100).
29 pub backlink_spam_score: Option<i64>,
30 /// Rank of this element on the configured scale (0-1000 by default).
31 pub rank: Option<i64>,
32 /// Rank of the referring page.
33 pub page_from_rank: Option<i64>,
34 /// Rank of the referring domain.
35 pub domain_from_rank: Option<i64>,
36 /// Platform types detected for the referring domain.
37 pub domain_from_platform_type: Option<Vec<String>>,
38 /// Whether the referring domain is an IP address.
39 pub domain_from_is_ip: Option<bool>,
40 /// IP address of the referring domain.
41 pub domain_from_ip: Option<String>,
42 /// Country of the referring domain.
43 pub domain_from_country: Option<String>,
44 /// Number of external links on the referring page.
45 pub page_from_external_links: Option<i64>,
46 /// Number of internal links on the referring page.
47 pub page_from_internal_links: Option<i64>,
48 /// Size of the referring page in bytes.
49 pub page_from_size: Option<i64>,
50 /// Character encoding of the referring page.
51 pub page_from_encoding: Option<String>,
52 /// Language of the referring page.
53 pub page_from_language: Option<String>,
54 /// Title of the referring page.
55 pub page_from_title: Option<String>,
56 /// HTTP status code of the referring page.
57 pub page_from_status_code: Option<i32>,
58 /// Date and time the element was first found (UTC).
59 pub first_seen: Option<String>,
60 /// Date and time the backlink was seen before `last_seen` (UTC).
61 pub prev_seen: Option<String>,
62 /// Date and time the backlink was last seen (UTC).
63 pub last_seen: Option<String>,
64 /// Type of the backlink (anchor, image, redirect, ...).
65 pub item_type: Option<String>,
66 /// HTML attributes of the backlink (nofollow, ugc, ...).
67 pub attributes: Option<Vec<String>>,
68 /// Whether the backlink is dofollow.
69 pub dofollow: Option<bool>,
70 /// Whether the backlink is still present on the referring page.
71 pub original: Option<bool>,
72 /// Alt text of the backlink when it is an image.
73 pub alt: Option<String>,
74 /// URL of the image when the backlink is an image link.
75 pub image_url: Option<String>,
76 /// Anchor text of the referring links.
77 pub anchor: Option<String>,
78 /// Text immediately preceding the anchor.
79 pub text_pre: Option<String>,
80 /// Text immediately following the anchor.
81 pub text_post: Option<String>,
82 /// HTML semantic location of the backlink on the referring page.
83 pub semantic_location: Option<String>,
84 /// Number of links from the referring page to the target.
85 pub links_count: Option<i64>,
86 /// Number of grouped backlinks represented by this item.
87 pub group_count: Option<i64>,
88 /// Whether the backlink is broken.
89 pub is_broken: Option<bool>,
90 /// HTTP status code returned by the `url_to` page.
91 pub url_to_status_code: Option<i32>,
92 /// Spam score of the `url_to` page (0-100).
93 pub url_to_spam_score: Option<i64>,
94 /// Redirect target of the `url_to` page, if any.
95 pub url_to_redirect_target: Option<String>,
96 /// Ranked-keyword counts for the referring page.
97 pub ranked_keywords_info: Option<BacklinksElementBacklinkRankKeywordsInfo>,
98 /// Whether the backlink reaches the target through a redirect or canonical chain.
99 pub is_indirect_link: Option<bool>,
100 /// Redirect/canonical chain followed by an indirect backlink.
101 pub indirect_link_path: Option<Vec<BacklinksElementIndirectLinkPath>>,
102}
103
104/// Ranked-keyword counts for the page a backlink originates from.
105#[derive(Debug, Default, Serialize, Deserialize, Clone)]
106pub struct BacklinksElementBacklinkRankKeywordsInfo {
107 /// Number of keywords the referring page ranks for in the top 3.
108 pub page_from_keywords_count_top_3: Option<i64>,
109 /// Number of keywords the referring page ranks for in the top 10.
110 pub page_from_keywords_count_top_10: Option<i64>,
111 /// Number of keywords the referring page ranks for in the top 100.
112 pub page_from_keywords_count_top_100: Option<i64>,
113}
114
115/// A single hop in the redirect/canonical chain of an indirect backlink.
116/// See <https://docs.dataforseo.com/v3/backlinks/backlinks/live/>.
117#[derive(Debug, Default, Serialize, Deserialize, Clone)]
118pub struct BacklinksElementIndirectLinkPath {
119 /// Element type identifier for this item.
120 #[serde(rename = "type")]
121 pub type_of_element: Option<String>,
122 /// HTTP status code returned by this hop.
123 pub status_code: Option<i32>,
124 /// URL of this hop in the redirect/canonical chain.
125 pub url: Option<String>,
126}