# Посилання

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/on_page/links`

**Tags:** DataForSEO

Усі посилання, знайдені під час обходу, за `id`. Фільтруйте через `page_from` і `page_to`, щоб отримати посилання з однієї сторінки або на неї. Повертає `total_items_count`, `items_count`, `items` і `search_after_token` для посторінкової видачі — використовуйте його замість `offset` після перших сторінок. Читає завершений обхід, тому потрібен `id` із `post_dataforseo_on_page_submit`, і повертає `crawl_progress` та `crawl_status` зі значеннями `max_crawl_pages`, `pages_in_queue` і `pages_crawled` — перевіряйте їх, перш ніж довіряти невеликому результату: обхід, що ще триває, просто має менше даних. 💰 Безкоштовно на боці upstream: запит до завершеного обходу нічого не коштує, платити треба лише за сам обхід.

### Довідкові ціни

- Тарифікація: вартість відповіді за даними постачальника.
- Довідкова оцінка запиту: USD 0.012.
- Довідковий множник для клієнта: 1.0. Не застосовуйте його повторно до вже розрахованої суми клієнта.

Довідкові метадані, а не котирування для облікового запису, гарантована ціна чи ліміт витрат. Кредити ресурсів — це не кредити Felo. Остаточні списання здійснюються за записами білінгу Felo.

## Related links

- [Task POST](<https://docs.dataforseo.com/v3/on_page/task_post/>)
- [за цим посиланням.](<https://docs.dataforseo.com/v3/on_page/filters_and_thresholds/?bash>)
- [схема URL](<https://en.wikipedia.org/wiki/List_of_URI_schemes>)

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "<em>ID завдання</em><br><strong>обов'язкове поле</strong><br>цей ID можна отримати у відповіді ендпоінта Task POST<br>приклад:<br>\"07131248-1535-0216-1000-17384017ad04\""
          },
          "page_from": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>відносний URL сторінки</em><br>необов'язкове поле<br>під час використання цього поля відповідь API міститиме лише посилання з указаної сторінки<br>зверніть увагу, що в цьому полі можна вказувати лише відносні URL"
          },
          "page_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>відносний URL сторінки</em><br>необов'язкове поле<br>під час використання цього поля відповідь API міститиме лише внутрішні посилання, що ведуть на вказану сторінку<br>зверніть увагу, що в цьому полі можна вказувати лише відносні URL"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>максимальна кількість посилань, що повертаються</em><br>необов'язкове поле<br>значення за замовчуванням: <code>100</code><br>максимальне значення: <code>1000</code>"
          },
          "offset": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>зміщення в масиві результатів посилань, що повертаються</em><br>необов'язкове поле<br>значення за замовчуванням: <code>0</code><br>максимальне значення: <code>2000000</code><br>якщо вказати значення <code>10</code>, перші десять посилань у масиві результатів буде пропущено, а дані буде надано для наступних посилань"
          },
          "filters": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ]
            },
            "description": "<em>масив параметрів фільтрації результатів</em><br>необов'язкове поле<br><strong>можна додати кілька фільтрів одночасно (не більше 8)</strong><br>між умовами потрібно вказати логічний оператор <code>and</code> або <code>or</code><br>підтримуються такі оператори:<br><code>regex</code>, <code>not_regex</code>, <code>=</code>, <code>&lt;&gt;</code>, <code>in</code>, <code>not_in</code>, <code>like</code>, <code>not_like</code><br>оператор <code>%</code> можна використовувати з <code>like</code> і <code>not_like</code> для зіставлення будь-якого рядка довжиною від нуля символів<br>приклад:<br><code>[\"direction\",\"=\",\"external\"]</code><p><code>[[\"domain_to\",\"&lt;&gt;\",\"example.com\"],<br>\"and\",<br>[\"link_from\",\"not_like\",\"%example.com/blog%\"]]</code><p><code>[[\"direction\",\"=\",\"external\"],<br>\"and\",<br>[[\"link_from\",\"like\",\"%example.com/blog%\"],\"or\",[\"link_from\",\"like\",\"%example.com/help%\"]]]</code><p>Повний список можливих фільтрів доступний за цим посиланням."
          },
          "search_after_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>токен для наступних запитів</em><br>необов'язкове поле<br>надається в тому самому полі відповіді на кожен запит;<br>використовуйте цей параметр, щоб уникнути тайм-аутів під час отримання понад <code>20,000</code> результатів в одному запиті;<br>вказавши унікальне значення <code>search_after_token</code> з масиву відповіді, ви отримаєте наступні результати початкового завдання;<br>значення <code>search_after_token</code> є унікальними для кожного наступного завдання;<br><strong>Примітка:</strong> якщо в запиті вказано <code>search_after_token</code>, усі інші параметри мають збігатися з попереднім запитом"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>визначений користувачем ідентифікатор завдання</em><br>необов'язкове поле<br><em>обмеження — 255 символів</em><br>цей параметр дає змогу ідентифікувати завдання й зіставити його з результатом<br>вказане значення <code>tag</code> ви знайдете в об'єкті <code>data</code> відповіді"
          }
        },
        "example": [
          {
            "id": "07281559-0695-0216-0000-c269be8b7592",
            "page_from": "/apis/google-trends-api",
            "filters": [
              [
                "dofollow",
                "=",
                true
              ],
              "and",
              [
                "direction",
                "=",
                "external"
              ]
            ],
            "limit": 10
          }
        ]
      }
    ]
  },
  "example": [
    {
      "id": "07281559-0695-0216-0000-c269be8b7592",
      "page_from": "/apis/google-trends-api",
      "filters": [
        [
          "dofollow",
          "=",
          true
        ],
        "and",
        [
          "direction",
          "=",
          "external"
        ]
      ],
      "limit": 10
    }
  ]
}
```

## Responses

### 200 — Успішна операція

Headers:
- `X-Request-Id` (string) — Ідентифікатор запиту, який потрібно вказати під час звернення до підтримки Felo.

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_OnPageLinksResponseInfo"
    }
  ]
}
```

### 400 — Не вдалося обробити запит. Перевірте параметри запиту.

### 401 — Потрібен дійсний API-ключ Felo.

### 402 — Запит неможливо виконати: умови білінгу не виконано.

### 403 — Обліковий запис не має дозволу на цю операцію.

### 429 — Досягнуто ліміту запитів або витрат.

### 502 — Служба не змогла виконати запит.

### 503 — API або служба білінгу тимчасово недоступні.

### 504 — Час очікування обробки запиту вичерпано.

### default — Відповідь із помилкою; наскрізні відповіді апстріму можуть використовувати формати постачальника

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseOnPageLinkItem

`#/components/schemas/Response36Afe1097B20_BaseOnPageLinkItem`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "тип елемента"
    },
    "domain_from": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>домен, що посилається</em><br>посилання було знайдено на цьому домені"
    },
    "domain_to": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>домен, на який посилаються</em><br>посилання вказує на цей домен"
    },
    "page_from": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>сторінка, що посилається</em><br>відносний URL сторінки, на якій було знайдено посилання"
    },
    "page_to": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>сторінка, на яку посилаються</em><br>відносний URL сторінки, на яку вказує посилання"
    },
    "link_from": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>сторінка, що посилається</em><br>абсолютний URL сторінки, на якій було знайдено посилання"
    },
    "link_to": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>сторінка, на яку посилаються</em><br>абсолютний URL сторінки, на яку вказує посилання"
    },
    "dofollow": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>вказує, чи є посилання dofollow</em><br>якщо значення — <code>true</code>, посилання не має атрибута <code>rel=\"nofollow\"</code>"
    },
    "page_from_scheme": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>схема URL сторінки, що посилається</em>"
    },
    "page_to_scheme": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>схема URL сторінки, на яку посилаються</em>"
    },
    "direction": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>напрямок посилання</em><br>можливі значення: <code>internal</code>, <code>external</code>"
    },
    "is_broken": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>посилання бите</em><br>вказує, чи веде посилання на биту сторінку або ресурс"
    },
    "is_link_relation_conflict": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>вказує, що посилання може конфліктувати з іншим посиланням</em><br>якщо <code>true</code>, щонайменше одне посилання, що вказує на <code>link_to</code>, має атрибут <code>rel=\"nofollow\"</code> <strong>і</strong> щонайменше одне є dofollow"
    },
    "page_to_status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>код стану сторінки, на яку посилаються</em><br>код стану сторінки, на яку вказує посилання"
    }
  },
  "additionalProperties": false,
  "discriminator": {
    "propertyName": "type",
    "mapping": {
      "anchor": "#/components/schemas/Response36Afe1097B20_OnPageAnchorLinkItem",
      "image": "#/components/schemas/Response36Afe1097B20_OnPageImageLinkItem",
      "canonical": "#/components/schemas/Response36Afe1097B20_OnPageCanonicalLinkItem",
      "alternate": "#/components/schemas/Response36Afe1097B20_OnPageAlternateLinkItem",
      "link": "#/components/schemas/Response36Afe1097B20_OnPageLinkLinkItem",
      "redirect": "#/components/schemas/Response36Afe1097B20_OnPageRedirectLinkItem",
      "meta": "#/components/schemas/Response36Afe1097B20_OnPageMetaLinkItem"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "поточна версія API"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "загальний код стану.\nПовний список кодів відповіді можна знайти тут."
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "загальне інформаційне повідомлення.\nПовний список загальних інформаційних повідомлень можна знайти тут."
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "загальний час виконання, секунди"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "загальна вартість завдань, USD",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "кількість завдань у масиві tasks",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "кількість завдань у масиві tasks, повернутих з помилкою",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "ідентифікатор завдання\nунікальний ідентифікатор завдання в нашій системі у форматі UUID"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "код стану завдання\nформується DataForSEO, може перебувати в діапазоні 10000-60000\nПовний список кодів відповіді можна знайти тут."
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "інформаційне повідомлення завдання\nПовний список загальних інформаційних повідомлень можна знайти тут."
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "час виконання, секунди"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "загальна вартість завдань, USD",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "кількість елементів у масиві result",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "шлях URL"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "містить ті самі параметри, які ви вказали в POST-запиті"
    }
  }
}
```

### Response36Afe1097B20_CrawlStatusInfo

`#/components/schemas/Response36Afe1097B20_CrawlStatusInfo`

```json
{
  "type": "object",
  "properties": {
    "max_crawl_pages": {
      "type": [
        "integer",
        "null"
      ],
      "description": "максимальна кількість сторінок для обходу\nвказує ліміт max_crawl_pages, який ви задали під час постановки завдання",
      "format": "int64"
    },
    "pages_in_queue": {
      "type": [
        "integer",
        "null"
      ],
      "description": "кількість сторінок, які зараз перебувають у черзі на обхід",
      "format": "int64"
    },
    "pages_crawled": {
      "type": [
        "integer",
        "null"
      ],
      "description": "кількість обійдених сторінок",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_OnPageLinksResponseInfo

`#/components/schemas/Response36Afe1097B20_OnPageLinksResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_OnPageLinksTaskInfo"
              }
            ]
          },
          "description": "<em>масив завдань</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_OnPageLinksResultInfo

`#/components/schemas/Response36Afe1097B20_OnPageLinksResultInfo`

```json
{
  "type": "object",
  "properties": {
    "crawl_progress": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>статус сеансу сканування</em><br>можливі значення: <code>in_progress</code>, <code>finished</code>"
    },
    "crawl_status": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_CrawlStatusInfo"
        }
      ],
      "description": "<em>відомості про сеанс сканування</em>"
    },
    "search_after_token": {
      "type": [
        "string",
        "null"
      ]
    },
    "current_offset": {
      "type": [
        "integer",
        "null"
      ]
    },
    "total_items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>загальна кількість релевантних елементів у базі даних</em>",
      "format": "int64"
    },
    "items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>кількість елементів у масиві результатів</em>",
      "format": "int64"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_BaseOnPageLinkItem"
          }
        ]
      },
      "description": "<em>масив елементів</em>"
    }
  }
}
```

### Response36Afe1097B20_OnPageLinksTaskInfo

`#/components/schemas/Response36Afe1097B20_OnPageLinksTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_OnPageLinksResultInfo"
              }
            ]
          },
          "description": "<em>масив результатів</em>"
        }
      }
    }
  ]
}
```
