# JobsDB-HK Scraper (`toodeep/jobsdb-hk-scraper`) Actor

🧰 What This Scraper Does

This scraper extracts job listings from hk.jobsdb, pulling key information such as:

- `company_name`

- `job_title`

- `salary`

- `work_type`

- `job_description`

- `job_responsibilities`

- **URL**: https://apify.com/toodeep/jobsdb-hk-scraper.md

- **Developed by:** [Mandeep](https://apify.com/toodeep) (community)

- **Categories:** AI, Jobs, Social media

- **Stats:** 12 total users, 0 monthly users, 93.8% runs succeeded, 2 bookmarks

- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## JobsDB HK Scraper Actor

**JobsDB HK Scraper Actor** is a private Apify Actor that scrapes job listings from HK JobsDB. The Actor leverages a headless browser via Playwright and an integrated Deepseek API call to accurately extract and structure job details—all without generating any new data.

### Overview

This Actor scrapes job listings based on user-specified keywords and returns structured data that includes the following six fields (in this order):

1. **Job Title**
2. **Company Name**
3. **Work Type**
4. **Salary**
5. **Job Description** (presented as bullet points)
6. **Job Responsibilities** (presented as bullet points)

Deepseek is used to process each job listing so that the output data precisely reflects what is present on the web page. Any missing field defaults to “Not mentioned.”

### Key Features

- **Headless Browsing with Playwright:** Navigates the JobsDB pages and collects job listings.
- **Deepseek API Integration:** Processes raw job listing text to extract the six required fields.
- **Responsive Dataset Output:** The resulting output is automatically transformed into a neatly organized, responsive table (configured via a dataset schema in the Actor settings) with the following order:
  1. Job Title
  2. Company Name
  3. Work Type
  4. Salary
  5. Job Description
  6. Job Responsibilities
- **Robust Processing:** Includes input validation, error handling, and fallback behavior in case Deepseek fails.

### How It Works

1. **Input:**
   - The Actor accepts an input JSON containing a comma-separated list of keywords (e.g., `"security, researcher"`) and a maximum number of job entries.

2. **Scraping Process:**
   - A search URL is dynamically built based on the keywords.
   - Playwright navigates through search result pages and collects each job’s basic details.
   - Each job’s detailed page is loaded and its text content is extracted.

3. **Data Extraction with Deepseek:**
   - The scraped text is sent to Deepseek with a prompt instructing it to extract only the following fields (in order):
     1. Job Title
     2. Company Name
     3. Work Type
     4. Salary
     5. Job Description (bullet points)
     6. Job Responsibilities (bullet points)
   - Deepseek returns a JSON response which is parsed and saved as a single record with the six fields combined into a user-friendly format (i.e. multiline bullet lists for descriptions/responsibilities).

4. **Output:**
   - The final structured data is saved to a dataset, which is rendered in a responsive table as defined in our dataset schema.
   - The dataset columns appear in this order:
     1. Job Title
     2. Company Name
     3. Work Type
     4. Salary
     5. Job Description
     6. Job Responsibilities

5. **Deepseek API Check:**
   - At startup, the Actor pings the Deepseek API (using a simple “Hello, who are you?” message) and logs the raw response. This confirms that the API key is valid and Deepseek is responsive before starting the scraping process.

### Usage

- **Deploying:**\
  The Actor is deployed to the Apify Platform using the private repository configuration. Once deployed, simply provide the input via the Apify input schema and start the Actor.

- **Input Parameters:**
  - `keywords`: A comma-separated list of search keywords.
  - `maxEntries`: The maximum number of job listings to process.

- **Output:**\
  The dataset will display the scraped job data in the internal Apify Output UI in the six-field format defined above.

### Additional Notes

- All fields are strictly extracted from the source data using Deepseek; no new content is generated.
- The code is designed for internal use and tailored to meet our specific data extraction needs from HK JobsDB.

Happy scraping!

# Actor input Schema

## `keywords` (type: `string`):

Comma-separated keywords for the job search (e.g., 'Researcher, Language'). The scraper will search for jobs matching these terms.

## `maxEntries` (type: `integer`):

Maximum number of job listings to scrape. Set a reasonable limit to avoid excessive scraping.

## Actor input object example

```json
{
  "keywords": "Researcher, Language",
  "maxEntries": 50
}
```

# 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 = {
    "keywords": "Researcher, Language"
};

// Run the Actor and wait for it to finish
const run = await client.actor("toodeep/jobsdb-hk-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 = { "keywords": "Researcher, Language" }

# Run the Actor and wait for it to finish
run = client.actor("toodeep/jobsdb-hk-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 '{
  "keywords": "Researcher, Language"
}' |
apify call toodeep/jobsdb-hk-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,toodeep/jobsdb-hk-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/FcDLUnzaMhaUVIgxO/builds/AOYklMftupWEhSQQz/openapi.json
