{
  "openapi": "3.0.1",
  "info": {
    "title": "Hacker News Scraper: Dead Links & Archived Copies",
    "description": "Hacker News recommends links forever and never rechecks them. Point this at the front page, or at every story above 300 points from 2013, and it reports the dead links, the redirects that answer 200 OK while the article is gone, and the domains nobody has registered - with an archived copy of each.",
    "version": "0.1",
    "x-build-id": "OPkd6QqQyjXB6tZ3p"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aiqlabs~hacker-news-link-rot/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aiqlabs-hacker-news-link-rot",
        "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/aiqlabs~hacker-news-link-rot/runs": {
      "post": {
        "operationId": "runs-sync-aiqlabs-hacker-news-link-rot",
        "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/aiqlabs~hacker-news-link-rot/run-sync": {
      "post": {
        "operationId": "run-sync-aiqlabs-hacker-news-link-rot",
        "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",
        "properties": {
          "list": {
            "title": "Which Hacker News list to check",
            "enum": [
              "topstories",
              "beststories",
              "newstories",
              "askstories",
              "showstories",
              "jobstories"
            ],
            "type": "string",
            "description": "Used when no search and no story ids are given. These are the live lists from the official Firebase API: topstories and newstories hold 500, beststories 200, the rest fewer. Checking a live list mostly reports healthy links - the rot is in the archive, which you reach with the search fields below.",
            "default": "topstories"
          },
          "minPoints": {
            "title": "Only stories with at least this many points",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Setting this switches the run to the Hacker News search index, which reaches back to 2007. A points floor is how you find the links that mattered: a story that got 2,000 points and now leads nowhere is a different problem from one that got 3.",
            "default": 0
          },
          "fromYear": {
            "title": "Earliest year to include",
            "minimum": 2006,
            "maximum": 2100,
            "type": "integer",
            "description": "Optional, and worth setting: a narrow window usually gets an exact match count out of the search API, where a broad one gets an estimate the size of the whole index. It also keeps each query inside the API's 1,000-result ceiling. Hacker News began in 2007."
          },
          "toYear": {
            "title": "Latest year to include",
            "minimum": 2006,
            "maximum": 2100,
            "type": "integer",
            "description": "Optional. Inclusive - 2014 means up to the end of 2014. Pair it with fromYear to keep each query inside the search API's 1,000-result ceiling."
          },
          "query": {
            "title": "Search terms",
            "type": "string",
            "description": "Optional free text, matched against story titles and URLs by the Hacker News search index. Leave it empty to take everything that fits the other filters.",
            "default": ""
          },
          "minComments": {
            "title": "Only stories with at least this many comments",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional alternative to a points floor. Like minPoints, setting it switches the run to the search index.",
            "default": 0
          },
          "storyIds": {
            "title": "Specific story ids or Hacker News item URLs",
            "type": "array",
            "description": "Optional, and takes priority over everything else. Accepts bare ids and news.ycombinator.com/item?id=... URLs. Comments and polls are refused with a reason rather than audited, because they carry no outbound link.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "checkDomainRegistration": {
            "title": "Ask the registry who holds a domain behind a dead link",
            "type": "boolean",
            "description": "Only for links that already failed. This is what separates 'the page is gone' from 'the address is free for anyone to take' - the second means a stranger can register the domain and decide what a decade of accumulated links now points at.",
            "default": true
          },
          "findArchivedCopies": {
            "title": "Look for an archived copy of each dead link",
            "type": "boolean",
            "description": "Asks the Internet Archive for the capture nearest the date the story was posted, rather than the most recent one - the last capture of a dead domain is usually a parking page. Only captures that were themselves successful are offered.",
            "default": true
          },
          "onlyIssues": {
            "title": "Only output stories with something to report",
            "type": "boolean",
            "description": "Leave this off to get a row per story including the healthy ones, which is what you want when the output feeds a spreadsheet.",
            "default": false
          },
          "maxStories": {
            "title": "Maximum stories to check",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "A ceiling on the run. Anything dropped is stated in SUMMARY rather than silently truncated. The search index itself will not return more than 1,000 results for one query, whatever you put here.",
            "default": 200
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "How long to wait for any one request - the Hacker News API, somebody's website, the Internet Archive, or a registry - before giving up on it and recording the reason.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}