# Links

**API:** Data API

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

**Tags:** DataForSEO

Every link found during a crawl, by `id`. Filter with `page_from` and `page_to` to get the links out of or into one page. Returns `total_items_count`, `items_count`, `items`, and a `search_after_token` for paging - use that rather than `offset` past the first pages. Reads a finished crawl, so it needs the `id` from `post_dataforseo_on_page_submit` and returns `crawl_progress` plus a `crawl_status` of `max_crawl_pages`, `pages_in_queue` and `pages_crawled` - check those before trusting a small result, because a crawl still running simply has less to report. 💰 Free upstream: querying a finished crawl costs nothing, only the crawl itself does.

### Pricing reference

- Metering: Reported response cost.
- Reference request estimate: USD 0.012.
- Reference customer multiplier: 1.0. Do not apply it again to a settled customer amount.

Reference metadata only, not an account quote, a guaranteed price or a spending cap. Resource credits are not Felo credits. Final charges follow Felo billing records.

## Related links

- [Task POST](<https://docs.dataforseo.com/v3/on_page/task_post/>)
- [by this link.](<https://docs.dataforseo.com/v3/on_page/filters_and_thresholds/?bash>)
- [url scheme](<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 of the task</em><br><strong>required field</strong><br>you can get this ID in the response of the Task POST endpoint<br>example:<br>\"07131248-1535-0216-1000-17384017ad04\""
          },
          "page_from": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>relative page URL</em><br>optional field<br>if you use this field, the API response will contain only links from the specified page<br>note that in this field you can specify relative URLs only"
          },
          "page_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>relative page URL</em><br>optional field<br>if you use this field, the API response will contain only internal links pointing to the specified page<br>note that in this field you can specify relative URLs only"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>the maximum number of returned links</em><br>optional field<br>default value: <code>100</code><br>maximum value: <code>1000</code>"
          },
          "offset": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>offset in the results array of returned links</em><br>optional field<br>default value: <code>0</code><br>maximum value: <code>2000000</code><br>if you specify the <code>10</code> value, the first ten links in the results array will be omitted and the data will be provided for the successive links"
          },
          "filters": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ]
            },
            "description": "<em>array of results filtering parameters</em><br>optional field<br><strong>you can add several filters at once (8 filters maximum)</strong><br>you should set a logical operator <code>and</code>, <code>or</code> between the conditions<br>the following operators are supported:<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>you can use the <code>%</code> operator with <code>like</code> and <code>not_like</code> to match any string of zero or more characters<br>example:<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>The full list of possible filters is available by this link."
          },
          "search_after_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>token for subsequent requests</em><br>optional field<br>provided in the identical filed of the response to each request;<br>use this parameter to avoid timeouts while trying to obtain over <code>20,000</code> results in a single request;<br>by specifying the unique <code>search_after_token</code> value from the response array, you will get the subsequent results of the initial task;<br><code>search_after_token</code> values are unique for each subsequent task ;<br><strong>Note:</strong> if the <code>search_after_token</code> is specified in the request, all other parameters should be identical to the previous request"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>user-defined task identifier</em><br>optional field<br><em>the character limit is 255</em><br>you can use this parameter to identify the task and match it with the result<br>you will find the specified <code>tag</code> value in the <code>data</code> object of the response"
          }
        },
        "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 — Successful operation

Headers:
- `X-Request-Id` (string) — Request identifier to include when contacting Felo support.

**application/json**

Schema: object | null

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

### 400 — The request could not be processed. Check the request parameters.

### 401 — A valid Felo API key is required.

### 402 — The request cannot proceed because a billing requirement is not met.

### 403 — The account is not permitted to perform this operation.

### 429 — A request or spending limit has been reached.

### 502 — The service could not complete the request.

### 503 — The API or billing service is temporarily unavailable.

### 504 — The service timed out while processing the request.

### default — Error response; upstream passthrough responses may use provider formats

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseOnPageLinkItem

`#/components/schemas/Response36Afe1097B20_BaseOnPageLinkItem`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "type of element"
    },
    "domain_from": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>referring domain</em><br>the link was found on this domain"
    },
    "domain_to": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>referenced domain</em><br>the link is pointing to this domain"
    },
    "page_from": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>referring page</em><br>relative URL of the page on which the link was found"
    },
    "page_to": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>referenced page</em><br>relative URL of the page to which the link is pointing"
    },
    "link_from": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>referring page</em><br>absolute URL of the page on which the link was found"
    },
    "link_to": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>referenced page</em><br>absolute URL of the page to which the link is pointing"
    },
    "dofollow": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>indicates whether the link is dofollow</em><br>if the value is <code>true</code>, the link doesn't have a <code>rel=\"nofollow\"</code> attribute"
    },
    "page_from_scheme": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>url scheme of the referring page</em>"
    },
    "page_to_scheme": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>url scheme of the referenced page</em>"
    },
    "direction": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>direction of the link</em><br>possible values: <code>internal</code>, <code>external</code>"
    },
    "is_broken": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>link is broken</em><br>indicates whether a link is directing to a broken page or resource"
    },
    "is_link_relation_conflict": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>indicates that the link may have a conflict with another link</em><br>if <code>true</code>, at least one link pointing to <code>link_to</code> has a <code>rel=\"nofollow\"</code> attribute <strong>and</strong> at least one is dofollow"
    },
    "page_to_status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>status code of the referenced page</em><br>status code of the page to which the link is pointing"
    }
  },
  "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": "the current version of the API"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "general status code\nyou can find the full list of the response codes here"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "general informational message\nyou can find the full list of general informational messages here"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "total execution time, seconds"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "total tasks cost, USD",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "the number of tasks in the tasks array",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "the number of tasks in the tasks array returned with an error",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "task identifier\nunique task identifier in our system in the UUID format"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "status code of the task\ngenerated by DataForSEO, can be within the following range: 10000-60000\nyou can find the full list of the response codes here"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "informational message of the task\nyou can find the full list of general informational messages here"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "execution time, seconds"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "total tasks cost, USD",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "number of elements in the result array",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL path"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "contains the same parameters that you specified in the POST request"
    }
  }
}
```

### Response36Afe1097B20_CrawlStatusInfo

`#/components/schemas/Response36Afe1097B20_CrawlStatusInfo`

```json
{
  "type": "object",
  "properties": {
    "max_crawl_pages": {
      "type": [
        "integer",
        "null"
      ],
      "description": "maximum number of pages to crawl\n indicates the max_crawl_pages limit you specified when setting a task",
      "format": "int64"
    },
    "pages_in_queue": {
      "type": [
        "integer",
        "null"
      ],
      "description": "number of pages that are currently in the crawling queue",
      "format": "int64"
    },
    "pages_crawled": {
      "type": [
        "integer",
        "null"
      ],
      "description": "number of crawled pages",
      "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>array of tasks</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_OnPageLinksResultInfo

`#/components/schemas/Response36Afe1097B20_OnPageLinksResultInfo`

```json
{
  "type": "object",
  "properties": {
    "crawl_progress": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>status of the crawling session</em><br>possible values: <code>in_progress</code>, <code>finished</code>"
    },
    "crawl_status": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_CrawlStatusInfo"
        }
      ],
      "description": "<em>details of the crawling session</em>"
    },
    "search_after_token": {
      "type": [
        "string",
        "null"
      ]
    },
    "current_offset": {
      "type": [
        "integer",
        "null"
      ]
    },
    "total_items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>total number of relevant items in the database</em>",
      "format": "int64"
    },
    "items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>number of items in the results array</em>",
      "format": "int64"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_BaseOnPageLinkItem"
          }
        ]
      },
      "description": "<em>items array</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>array of results</em>"
        }
      }
    }
  ]
}
```
