Getting information about external links to the site

Description

Gets examples of external links to site pages.

Request format

Send a GET request to the operation address for the links/external/samples resource for the user's site:

GET https://api.webmaster.yandex.net/v3/user/{user-id}/hosts/{host-id}/links/external/samples/[?offset={offset}&limit={limit}]

Path parameters

Name Required Type Default value Description
user-id Yes int64 The user ID.
host-id Yes host id Site ID.

Query arguments

Name Required Type Default value Description
Offset No int32 0 Offset in the list. The minimum value is 0.
Limit No int32 10 Page size (1-100).

Response format

If successful, the server returns 200 OK and a list of external links:

Samples

{
  "count": 1,
  "links": [
    {
      "source_url": "explicit error message",
      "destination_url": "explicit error message",
      "discovery_date": "2016-01-01",
      "source_last_access_date": "2016-01-01",
    }, ...
  ]
}
Name Required Type Description
count Yes int64 The number of link examples available.
source_url Yes string The URL of a page containing a link to the site.
destination_url Yes string The URL of the destination page that the link goes to.
discovery date Yes yyyy-MM-ddTHH:mm:ss,sssZ The date when the link was detected.
source_last_access_date Yes yyyy-MM-ddTHH:mm:ss,sssZ The date when the robot last visited the link destination page.

Errors

403 Forbidden

The user ID for the token doesn't match the one specified in the request. In the examples below, {user_id} is the correct uid for the owner of the OAuth token.

{
  "error_code": "INVALID_USER_ID",
  "available_user_id": 1,
  "error_message": "Invalid user id. {user_id} should be used."
}
Parameter Description
error_code Error code.
available_user_id ID of the user who allowed access.
error_message Error message.

404 Not Found

The site isn't in the list of the user's sites, or rights to the site haven't been verified.

{
  "error_code": "HOST_NOT_VERIFIED",
  "host_id": "http:ya.ru:80",
  "error_message": "explicit error message"
}
Parameter Description
error_code Error code.
host_id The ID of the requested site.
error_message Error message.