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

🧰 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://beta-securitybyobscurity.apify.com/toodeep/jobsdb-hk-scraper.md

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

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

- **Stats:** 5 total users, 2 monthly users, 100.0% runs succeeded, 2 bookmarks

- **User rating**: 5.00 out of 5 stars

## Pricing

$11.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.
You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

# 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=toodeep/jobsdb-hk-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "JobsDB-HK Scraper",
        "description": "🧰 What This Scraper Does\n\nThis scraper extracts job listings from hk.jobsdb, pulling key information such as:\n\n- `company_name`  \n- `job_title`  \n- `salary`  \n- `work_type`  \n- `job_description`  \n- `job_responsibilities`",
        "version": "0.0",
        "x-build-id": "AOYklMftupWEhSQQz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/toodeep~jobsdb-hk-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-toodeep-jobsdb-hk-scraper",
                "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/toodeep~jobsdb-hk-scraper/runs": {
            "post": {
                "operationId": "runs-sync-toodeep-jobsdb-hk-scraper",
                "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/toodeep~jobsdb-hk-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-toodeep-jobsdb-hk-scraper",
                "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": [
                    "keywords"
                ],
                "properties": {
                    "keywords": {
                        "title": "Keywords",
                        "type": "string",
                        "description": "Comma-separated keywords for the job search (e.g., 'Researcher, Language'). The scraper will search for jobs matching these terms."
                    },
                    "maxEntries": {
                        "title": "Maximum Listings",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of job listings to scrape. Set a reasonable limit to avoid excessive scraping.",
                        "default": 50
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
