# Hacker News Jobs Scraper (`jobsapi/hackernews-jobs-search-scraper`) Actor

Extract complete public Hacker News job posts from the official Firebase jobstories and item APIs.

- **URL**: https://apify.com/jobsapi/hackernews-jobs-search-scraper.md
- **Developed by:** [Jobs API](https://apify.com/jobsapi) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 hacker news job records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Hacker News Jobs Search Scraper

This Actor reads the official public Hacker News Firebase jobstories feed and item API. It emits only complete, detail-verified job rows. Operational diagnostics are written to key-value storage and are never mixed into the dataset.

The Actor does not fetch external company pages, log in, use a proxy, use fingerprinting or stealth, or bypass access controls. An HN item is the public detail record; an external URL is retained only when it is explicitly supplied by the HN item or post body.

### Supported modes

- search: fetch the bounded official feed, match one query against title/body, and emit complete jobs.
- searchMultiple: fetch the feed and item details once, then apply multiple queries with deduplication.
- single: fetch one official HN item page/API reference or numeric jobId.
- multiple: fetch a bounded list of official HN item references or numeric jobIds.
- startUrls: accept the official feed and/or official HN item references.

### Output

Rows include stable HN item identity, title/company/role/YC batch, author and normalized publication time, official HN URLs, explicit external/application links, normalized HTML and text descriptions, headings/sections/items, location/work-arrangement/compensation/email signals, score/comment count, verification flags, hashed request receipts, source completeness, and quality metrics. Raw API payloads and raw post HTML are never emitted.

RUN_SUMMARY, RUN_HEALTH, RUN_METADATA, RUN_REQUESTS, RUN_DIAGNOSTICS, and RUN_SKIPS are structured KVS records. No diagnostic object is emitted as a dataset row.

Transport, retry, proxy, concurrency, fixture, raw-payload, user-agent, and debug controls are not public inputs. The actor uses sequential ordinary direct HTTPS against the official Hacker News Firebase API. If the source returns an explicit access denial or human-verification challenge, the run stops as SKIPPED and publishes no partial jobs.

### Run status

`RUN_SUMMARY.status` reports the Apify platform lifecycle (`SUCCEEDED` or `FAILED`); `resultStatus` separately reports `COMPLETE`, `LIMITED`, `SKIPPED`, `DEFERRED`, `NO_DATA`, or `FAILED`. A persisted job prefix followed by a non-blocking dataset or artifact error remains `SUCCEEDED` / `LIMITED`. Fatal zero-row input, unexpected runtime, or persistence failures call `Actor.fail()` and report `FAILED` / `FAILED`. Ambiguous empty searches and ordinary source/transport failures are `SUCCEEDED` / `DEFERRED`; only an explicit access-denial response or challenge is `SUCCEEDED` / `SKIPPED`.

`NO_DATA` is reserved for a successful 2xx response from the official `jobstories.json` feed whose parsed result is exactly an empty array. The response URL, status, SHA-256 receipt, and zero-item evidence are retained in KVS. A query that finds no local match, an unrecognized response, or a failed request is not proof that the source is empty.

### Local verification

```text
npm install
npm run check
npm test
npm run lint
apify validate-schema
apify run --purge --input-file INPUT.json
npm run validate
```

The default INPUT.json uses a maximum of 31 official candidates; sequential local and Apify cloud scans remain bounded and normally complete well below four minutes.

# Actor input Schema

## `mode` (type: `string`):

Extraction mode: search, searchMultiple, single, multiple, or startUrls.

## `query` (type: `string`):

All terms must occur in the official HN job title or public job-post body.

## `queries` (type: `array`):

Queries for searchMultiple mode; each entry may specify query and optional location metadata.

## `searchQueries` (type: `array`):

Alias for queries in searchMultiple mode.

## `jobId` (type: `string`):

Numeric official Hacker News item ID for single mode.

## `jobIds` (type: `array`):

Numeric official Hacker News item IDs for multiple mode.

## `jobUrl` (type: `string`):

Official Hacker News item page or Firebase item API URL for single mode.

## `jobUrls` (type: `array`):

Official Hacker News item page or Firebase item API URLs for multiple mode.

## `startUrls` (type: `array`):

Official jobstories feed and/or official HN item URLs. External career pages are never fetched.

## `maxItems` (type: `integer`):

Maximum complete job records for search, direct, and startUrls modes; searchMultiple applies the limit per query before deduplication.

## `maxCandidates` (type: `integer`):

Maximum official jobstory IDs whose item details may be fetched during search modes.

## Actor input object example

```json
{
  "mode": "search",
  "query": "engineer",
  "startUrls": [
    {
      "url": "https://hacker-news.firebaseio.com/v0/jobstories.json"
    }
  ],
  "maxItems": 3,
  "maxCandidates": 12
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `diagnostics` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jobsapi/hackernews-jobs-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("jobsapi/hackernews-jobs-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call jobsapi/hackernews-jobs-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jobsapi/hackernews-jobs-search-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LrKezohW151XQ4xAc/builds/w89Yz4NpMki5Oad3G/openapi.json
