{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schema_version": {
      "anyOf": [
        {
          "type": "number",
          "const": 1
        },
        {
          "type": "number",
          "const": 2
        }
      ]
    },
    "baseline_run_id": {
      "type": "string"
    },
    "discovery_run_id": {
      "type": "string"
    },
    "scope": {
      "type": "object",
      "properties": {
        "domain": {
          "type": "string",
          "minLength": 1,
          "maxLength": 253
        },
        "include_subdomains": {
          "type": "boolean"
        },
        "website_revision": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "query_version": {
          "type": "string",
          "const": "dataforseo-as-is-v1"
        }
      },
      "required": [
        "domain",
        "include_subdomains",
        "website_revision",
        "query_version"
      ],
      "additionalProperties": false
    },
    "coverage": {
      "type": "object",
      "properties": {
        "whole_web": {
          "type": "boolean",
          "const": false
        },
        "sample": {
          "type": "boolean",
          "const": true,
          "description": "True: the rendered preview uses example content, never customer events."
        },
        "ordering": {
          "type": "string",
          "const": "rank,desc"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 80,
              "description": "Recorded explanation; null when no explanation applies."
            },
            {
              "type": "null"
            }
          ],
          "description": "Recorded explanation; null when no explanation applies."
        }
      },
      "required": [
        "whole_web",
        "sample",
        "ordering",
        "reason"
      ],
      "additionalProperties": false,
      "description": "Dataset scope and completeness, including limits on what these results establish."
    },
    "items": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "v": {
            "type": "number",
            "const": 1
          },
          "id": {
            "type": "string",
            "pattern": "^dc_[a-f0-9]{64}$",
            "description": "Resource identifier returned by the operation."
          },
          "workspace_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "Workspace that owns this record."
          },
          "project_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "description": "Project that owns this record."
          },
          "discovery_run_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "source_url": {
            "type": "string",
            "maxLength": 4096,
            "description": "Publisher page URL recorded in this evidence."
          },
          "target_url": {
            "type": "string",
            "maxLength": 4096,
            "description": "Destination URL recorded in this evidence."
          },
          "provider": {
            "type": "string",
            "enum": [
              "linktrail_corpus",
              "dataforseo",
              "imported"
            ]
          },
          "data_mode": {
            "type": "string",
            "enum": [
              "synthetic",
              "owned_corpus",
              "provider_index",
              "imported"
            ]
          },
          "provider_retrieved_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
            "description": "Timestamp when the upstream evidence was retrieved."
          },
          "provider_first_seen": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider_prev_seen": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider_last_seen": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider_status": {
            "type": "object",
            "properties": {
              "is_lost": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_broken": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_new": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "is_lost",
              "is_broken",
              "is_new"
            ],
            "additionalProperties": false
          },
          "anchor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096
              },
              {
                "type": "null"
              }
            ]
          },
          "rel": {
            "anyOf": [
              {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "dofollow": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "link_type": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "source_http_status": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 599
              },
              {
                "type": "null"
              }
            ]
          },
          "target_http_status": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 599
              },
              {
                "type": "null"
              }
            ]
          },
          "links_count": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "provider_metrics": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "dataforseo": {
                    "type": "object",
                    "properties": {
                      "rank": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "page_from_rank": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "domain_from_rank": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1000
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "backlink_spam_score": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "rank_scale": {
                        "type": "string",
                        "const": "one_thousand"
                      }
                    },
                    "required": [
                      "rank",
                      "page_from_rank",
                      "domain_from_rank",
                      "backlink_spam_score",
                      "rank_scale"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "dataforseo"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "imported": {
                    "type": "object",
                    "properties": {
                      "supplier": {
                        "type": "string",
                        "enum": [
                          "ahrefs",
                          "google_search_console",
                          "bing_webmaster_tools",
                          "semrush",
                          "majestic",
                          "moz",
                          "dataforseo",
                          "linkody",
                          "csv"
                        ]
                      },
                      "supplier_row_id": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 256
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "supplier_generated_at": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "supplier_metrics": {
                        "anyOf": [
                          {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "string",
                                  "maxLength": 256
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "supplier",
                      "supplier_row_id",
                      "supplier_generated_at",
                      "supplier_metrics"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "imported"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "linktrail_corpus": {
                    "type": "object",
                    "properties": {
                      "source_outlink_count": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "source_external_outlink_count": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "fetch_kind": {
                        "type": "string",
                        "enum": [
                          "direct",
                          "rendered",
                          "proxied"
                        ]
                      },
                      "extraction_complete": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "source_outlink_count",
                      "source_external_outlink_count",
                      "fetch_kind",
                      "extraction_complete"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "linktrail_corpus"
                ],
                "additionalProperties": false
              }
            ]
          },
          "verification_status": {
            "type": "string",
            "enum": [
              "not_checked",
              "present",
              "absent",
              "unknown",
              "source_unavailable"
            ],
            "description": "AgentLinkOps check state, independent of supplier flags. not_checked means no AgentLinkOps check is recorded."
          },
          "verified_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
                "description": "Timestamp of the AgentLinkOps check; null until checked."
              },
              {
                "type": "null"
              }
            ],
            "description": "Timestamp of the AgentLinkOps check; null until checked."
          },
          "observation_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[a-zA-Z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "v",
          "id",
          "workspace_id",
          "project_id",
          "discovery_run_id",
          "source_url",
          "target_url",
          "provider",
          "data_mode",
          "provider_retrieved_at",
          "provider_first_seen",
          "provider_prev_seen",
          "provider_last_seen",
          "provider_status",
          "anchor",
          "rel",
          "dofollow",
          "link_type",
          "source_http_status",
          "target_http_status",
          "links_count",
          "provider_metrics",
          "verification_status",
          "verified_at",
          "observation_id"
        ],
        "additionalProperties": false,
        "description": "Records in this bounded page."
      },
      "description": "Records in this bounded page."
    },
    "has_more": {
      "type": "boolean",
      "description": "True when another page is available."
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string",
          "description": "Opaque continuation for the same listing; null means no further page."
        },
        {
          "type": "null"
        }
      ],
      "description": "Opaque continuation for the same listing; null means no further page."
    },
    "truncated": {
      "type": "boolean"
    },
    "snapshot": {
      "type": "object",
      "properties": {
        "through_provider_page": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "refresh_from_start_for_new_results": {
          "type": "boolean",
          "const": true
        }
      },
      "required": [
        "through_provider_page",
        "refresh_from_start_for_new_results"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schema_version",
    "baseline_run_id",
    "discovery_run_id",
    "scope",
    "coverage",
    "items",
    "has_more",
    "next_cursor",
    "truncated",
    "snapshot"
  ],
  "additionalProperties": false
}
