# Work Scraper (`trudax/work-scraper`) Actor

Extract data from the top freelancing websites such as Upwork. Search by URL or search terms, filter by categories, English level, and hourly rate. Get info about freelancers and agencies without login. Download your data as an HTML table, JSON, CSV, Excel, or XML.

- **URL**: https://apify.com/trudax/work-scraper.md
- **Developed by:** [Trudax](https://apify.com/trudax) (community)
- **Categories:** Jobs, Automation, Lead generation
- **Features:** Limited permissions
- **Stats:** 771 total users, 12 monthly users, 0.0% runs succeeded, 16 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

### What does Work Scraper do?

Work Scraper enables you to extract data from the top freelancers websites. It allows you to extract info from freelancers, jobs and agencies without login.
Here is a list of supported websites:

- Upwork

### Why scrape Work?

If you're a freelancer, you might use it to keep track of the competition or identify new opportunities. You can also automatically apply to the jobs by integrating with the [this other actor](https://apify.com/big-brain.io/upwork-application) actor and passing the `applyUrl`. Check the [integration documentation](https://docs.apify.com/integrations) for more details.

If you're an employer, you could gather data on potential freelancers, find your competitors on the platform, or make sure that your projects are targeted so as to attract the best talent.

### How much will it cost to scrape?

Work Scraper is efficient and cheap to run. It will only cost approx. $0.25 per 100 requests on top of the monthly rental fee.

### How to scrape

You can fill the search inputs in the actor or, if you want a more complex search, you can copy the url generated by your search in the origin website and use it as a `start url` in the actor inputs.

### Example results

The output of Work Scraper is stored in a dataset and will look something like this:

Freelancer profile:

```json
{
    "name": "John Dow",
    "location": "St. John's - Canada",
    "locality": "St. John's",
    "country": "Canada",
    "title": "Blockchain Developer",
    "description": "I believe highly in perfection in my work.  I have written short articles, reviews, as well as blog posts for different companies using WordPress and have done website testing as well. I am a gifted technical writer and article spinner.  I have also been a ghostwriter for multiple clients on a variety of both fiction and non-fiction writing.  I also do data entry on a daily basis into Excel books and am responsible for payroll at my full time job.  I have excellent communication skills and work as an administrative assistant on a full time basis.  I understand the need for quality work and communication to get the job done right!",
    "jobSuccess": "100%",
    "hourlyRate": "100.00",
    "totalHours": "835",
    "totalJobs": "20",
    "stats": [
        "20\nTotal Jobs",
        "835\nTotal Hours",
        "20 Total Jobs",
        "835 Total Hours",
        "20 Total Jobs",
        "835 Total Hours"
    ],
    "profileUrl": "https://www.website.com/freelancers/XXXXXX"
}
```

Job:

```json
{
    "title": "Job title",
    "description": "Job description",
    "jobType": "Hourly: $45.00",
    "contractorTier": "Intermediate",
    "skills": "Database\nDatabase Maintenance\nWeb Service\nJava\nGit\nSQLite\nCSS\nWeb Development\nHTML",
    "createdAt": "15 minutes ago",
    "scrapedAt": "2022-08-16T13:50:20.995Z",
    "url": "https://www.website.com/freelance-jobs/apply/XXXX/",
    "applyUrl": "https://www.website.com/ab/proposals/job/XXXX/apply/#/"
}
```

### Extend output function

You can use this function to update the result output of this actor. You can choose what data from the page you want to scrape. The output from this will function will get merged with the result output.

The return value of this function has to be an object!

You can return fields to archive 3 different things:

- Add a new field - Return object with a field that is not in the result output
- Change a field - Return an existing field with a new value
- Remove a field - Return an existing field with a value `undefined`

```js
async () => {
    return {
        pageTitle: document.querySelector("title").innerText,
    };
};
```

This example will add the title of the page to the final object:

```json
{
    "name": "John Dow",
    "location": "St. John's - Canada",
    "locality": "St. John's",
    "country": "Canada",
    "title": "Blockchain Developer",
    "description": "I believe highly in perfection in my work.  I have written short articles, reviews, as well as blog posts for different companies using WordPress and have done website testing as well. I am a gifted technical writer and article spinner.  I have also been a ghostwriter for multiple clients on a variety of both fiction and non-fiction writing.  I also do data entry on a daily basis into Excel books and am responsible for payroll at my full time job.  I have excellent communication skills and work as an administrative assistant on a full time basis.  I understand the need for quality work and communication to get the job done right!",
    "jobSuccess": "100%",
    "hourlyRate": "100.00",
    "totalHours": "835",
    "totalJobs": "20",
    "stats": [
        "20\nTotal Jobs",
        "835\nTotal Hours",
        "20 Total Jobs",
        "835 Total Hours",
        "20 Total Jobs",
        "835 Total Hours"
    ],
    "profileUrl": "https://www.website.com/freelancers/XXXXXX",
    "pageTitle": "John Doe - Fast, Friendly, Reliable!"
}
```

### Personal data

You should be aware that your results might contain personal data. Personal data is protected by GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

# Changelog

This Actor's version history is a separate document: https://apify.com/trudax/work-scraper/changelog.md

# Actor input Schema

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

URLs to start with.

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

How many search results should be processed

## `useLogin` (type: `boolean`):

Enable or disabled login

## `upworkLogin` (type: `string`):

You email to access your Upwork account

## `upworkPassword` (type: `string`):

You Upwork\`s account password

## `securityQuestion` (type: `string`):

Upwork may request your security question to make sure it you accessing your account

## `useBuiltInSearch` (type: `boolean`):

Use the fields below to perform a search and scrape the result

## `searchFor` (type: `string`):

Select what type of results you want. For more advanced searches, create your search on Upwork website and copy the url to use it in the scraper.

## `search` (type: `string`):

Words to be searched

## `category` (type: `string`):

Select a category to filter

## `englishLevel` (type: `string`):

Select the english level required

## `hourlyRate` (type: `string`):

Select an hourly rate

## `jobSuccess` (type: `string`):

Select a job success rate

## `earnedAmount` (type: `string`):

Select a minimul earned amount

## `billedAmount` (type: `string`):

Select a minimul earned amount

## `rhrs` (type: `boolean`):

Billed in the 6 last months only

## `extendOutputFunction` (type: `string`):

Here you can write your custom javascript code to extract custom data from the page.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## `debugMode` (type: `boolean`):

Display detailed logs and error messages

## Actor input object example

```json
{
  "startUrls": [
    "https://www.upwork.com/search/profiles/"
  ],
  "maxItems": 1,
  "useLogin": false,
  "searchFor": "talent",
  "extendOutputFunction": "async () => {\n  return { timestamp: Date.now() }\n\n}",
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "startUrls": [
        "https://www.upwork.com/search/profiles/"
    ],
    "maxItems": 1,
    "searchFor": "talent",
    "extendOutputFunction": async () => {
      return { timestamp: Date.now() }
    
    },
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("trudax/work-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 = {
    "startUrls": ["https://www.upwork.com/search/profiles/"],
    "maxItems": 1,
    "searchFor": "talent",
    "extendOutputFunction": """async () => {
  return { timestamp: Date.now() }

}""",
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("trudax/work-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 '{
  "startUrls": [
    "https://www.upwork.com/search/profiles/"
  ],
  "maxItems": 1,
  "searchFor": "talent",
  "extendOutputFunction": "async () => {\\n  return { timestamp: Date.now() }\\n\\n}",
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call trudax/work-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,trudax/work-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/QO4eKupwzgl5yAkKY/builds/7PrwB9K2rYOlc7bmk/openapi.json
