{
  "openapi": "3.0.1",
  "info": {
    "title": "Link Extractor: Extract All Links, Internal & External, Bulk",
    "description": "Link extractor for bulk URLs: extract all links from website pages as one row per link, with absolute URL, anchor text, internal or external type, nofollow, sponsored, UGC, file type and domain. Optional link status check and same-domain crawl.",
    "version": "0.1",
    "x-build-id": "WB6grTHXney2cH13h"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~link-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-link-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/data-done-right~link-extractor/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-link-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/data-done-right~link-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-link-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "Page URLs",
            "type": "array",
            "description": "Pages to extract links from, one per line. A bare domain such as example.com also works. Example: https://www.python.org.",
            "items": {
              "type": "string"
            }
          },
          "linkScope": {
            "title": "Which links",
            "enum": [
              "both",
              "internal",
              "external"
            ],
            "type": "string",
            "description": "Keep internal links (same site, www ignored), external links, or both. Mailto and tel links are only returned with 'both'. Default both.",
            "default": "both"
          },
          "dedupePerPage": {
            "title": "Remove duplicates per page",
            "type": "boolean",
            "description": "Return each link once per page and count repeats in the occurrences field. Turn off to get every link occurrence. Default on.",
            "default": true
          },
          "includePatterns": {
            "title": "Only links matching (regex)",
            "type": "array",
            "description": "Optional. Keep a link only if its absolute URL matches at least one of these regular expressions (case-insensitive). Example: \\.pdf$",
            "items": {
              "type": "string"
            }
          },
          "excludePatterns": {
            "title": "Skip links matching (regex)",
            "type": "array",
            "description": "Optional. Drop links whose absolute URL matches any of these regular expressions. Example: /(login|logout|cart)",
            "items": {
              "type": "string"
            }
          },
          "includeAnchors": {
            "title": "Include #anchor links",
            "type": "boolean",
            "description": "Also return links that jump to a section of the same page (type anchor). Default off.",
            "default": false
          },
          "includeMailtoTel": {
            "title": "Include mailto and tel links",
            "type": "boolean",
            "description": "Return email and phone links (type mailto, tel). Only applies when Which links is 'both'. Default on.",
            "default": true
          },
          "includeImageSources": {
            "title": "Include image sources",
            "type": "boolean",
            "description": "Also return one row per img src (type image, source img). Links that wrap an image are always flagged with isImageLink and imageSrc. Default off.",
            "default": false
          },
          "subdomainsAreInternal": {
            "title": "Treat subdomains as internal",
            "type": "boolean",
            "description": "If on, blog.example.com counts as internal for example.com. Default off.",
            "default": false
          },
          "checkStatus": {
            "title": "Check link status",
            "type": "boolean",
            "description": "Request each unique http(s) link (HEAD, then GET if HEAD is refused) and add statusCode, finalUrl (after redirects), redirectCount and ok to every row. Charged separately per link that answered. Default off.",
            "default": false
          },
          "maxChecks": {
            "title": "Max links to check",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Most unique links checked in one run; the rest get no status. Caps the cost of Check link status. Default 1000.",
            "default": 1000
          },
          "checkConcurrency": {
            "title": "Parallel status checks",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many links are checked at the same time. Default 10.",
            "default": 10
          },
          "crawlDepth": {
            "title": "Crawl depth",
            "minimum": 0,
            "maximum": 2,
            "type": "integer",
            "description": "0 = only the pages you list. 1 or 2 = also follow internal links to pages on the same site, up to this many levels. Default 0.",
            "default": 0
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Most pages fetched in the whole run, listed pages included. Applies to crawling. Default 50.",
            "default": 50
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt when crawling",
            "type": "boolean",
            "description": "Skip crawled pages that robots.txt disallows. Pages you list yourself are always fetched. Default on.",
            "default": true
          },
          "maxUrls": {
            "title": "Max listed URLs",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Most listed URLs processed. Extra ones are skipped. Default 100.",
            "default": 100
          },
          "maxLinks": {
            "title": "Max links",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Most link rows returned (and charged) in this run. Default 10000.",
            "default": 10000
          },
          "concurrency": {
            "title": "Parallel page requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages are fetched at the same time. Keep low for polite crawling. Default 5.",
            "default": 5
          },
          "retries": {
            "title": "Attempts per page",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Tries per page after timeouts, 429 or 5xx errors. Default 3.",
            "default": 3
          },
          "timeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Give up on one request after this many seconds. Default 30.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Fetch pages through Apify Proxy or your own proxies. Usually not needed for public pages.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}