# Greasy Fork Userscripts Scraper (`crawlerbros/greasy-fork-scraper`) Actor

Scrape Greasy Fork (greasyfork.org) - the largest userscript marketplace. Search userscripts by keyword, browse by target website or reusable code libraries, sort by popularity/rating/date, or fetch full script details including install count, ratings, target sites, license, and code size.

- **URL**: https://apify.com/crawlerbros/greasy-fork-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Greasy Fork Userscripts Scraper

Scrape **Greasy Fork** (greasyfork.org) - the web's largest userscript marketplace, home to tens of thousands of Tampermonkey/Violentmonkey/Greasemonkey scripts. Search by keyword, browse every userscript for a specific website, browse reusable code libraries, or pull full details (target sites, license, install count, ratings) for specific scripts by ID or URL.

### What this actor does

- **Five modes:** `search`, `bySite`, `libraries`, `byScriptIds`, `byAuthor`
- **Search by keyword** across script names and descriptions
- **Browse by target website** - every userscript that runs on a given domain
- **Browse code libraries** - shared code other userscripts depend on
- **Browse by author** - every userscript published by a specific Greasy Fork user
- **Full script detail lookup** - target sites, license, code size, long description
- **Sort by** relevance, total installs, ratings, created date, updated date, or name
- **Empty fields are omitted** - a field only appears when Greasy Fork actually shows it

### Output: userscripts (mode = `search` / `bySite` / `libraries`)

- `scriptId`, `name`, `description`
- `authors[]`, `primaryAuthor`, `authorIds[]`
- `language` - source language (`js` for nearly all userscripts)
- `scriptType` - `public` or `library`
- `version`
- `dailyInstalls`, `totalInstalls`
- `ratingScore`, `ratingGoodCount`, `ratingOkCount`, `ratingBadCount`
- `isSensitive` - Greasy Fork's mature-content flag
- `createdDate`, `updatedDate`
- `installUrl` - direct `.user.js` install link
- `detailUrl`, `sourceUrl`
- `recordType: "script"`, `scrapedAt`

### Output: script detail (mode = `byScriptIds`)

All of the above fields (except `language`/`scriptType`/`isSensitive`, not shown on the detail page), plus:

- `longDescription` - the script's full README/description
- `appliesTo[]` - target website domains
- `license`, `licenseUrl`
- `codeSize` - e.g. `64.5 KB`
- `namespace`
- `feedbackCount` - number of reviews/discussion posts
- `recordType: "scriptDetail"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | `search` / `bySite` / `libraries` / `byScriptIds` / `byAuthor` |
| `searchQuery` | string | `youtube` | Keyword search (mode=search) |
| `site` | string | - | Target website domain, e.g. `youtube.com` (mode=bySite) |
| `authorId` | string | - | Author numeric user ID or profile URL, e.g. `1` or `https://greasyfork.org/en/users/1-username` (mode=byAuthor) |
| `sortBy` | string | `relevance` | `relevance` / `totalInstalls` / `ratings` / `created` / `updated` / `name` (not honored for byAuthor) |
| `excludeSensitive` | boolean | `false` | Skip mature/sensitive-flagged scripts |
| `minTotalInstalls` | int | - | Drop scripts with fewer lifetime installs |
| `scriptIds` | array | - | Script IDs or URLs to look up (mode=byScriptIds) |
| `maxItems` | int | `30` | Hard cap on emitted records (1-500) |

#### Example: search by keyword

```json
{
  "mode": "search",
  "searchQuery": "dark mode",
  "sortBy": "totalInstalls",
  "maxItems": 30
}
```

#### Example: every userscript for a website

```json
{
  "mode": "bySite",
  "site": "github.com",
  "sortBy": "ratings",
  "maxItems": 50
}
```

#### Example: full detail for specific scripts

```json
{
  "mode": "byScriptIds",
  "scriptIds": ["406540", "https://greasyfork.org/en/scripts/563321-all-in-one-video-downloader-hd-youtube-tiktok-instagram-x-more"]
}
```

#### Example: browse popular code libraries

```json
{
  "mode": "libraries",
  "sortBy": "totalInstalls",
  "maxItems": 20
}
```

#### Example: every script by a specific author

```json
{
  "mode": "byAuthor",
  "authorId": "1",
  "sortBy": "updated",
  "maxItems": 30
}
```

### Use cases

- **Browser extension developers** - discover popular userscripts for a target site before building a competing feature
- **Security research** - audit widely-installed scripts for a given website by install count and rating
- **Tooling curation** - build a "best userscripts for X" directory or newsletter
- **Trend tracking** - monitor `sortBy=updated`/`created` to see what's actively maintained
- **Dependency research** - browse `libraries` mode to find reusable code other scripts build on

### FAQ

**What is the data source?**
Greasy Fork's own public script listing and detail pages (greasyfork.org). No login required.

**What's the difference between `search` and `bySite`?**
`search` matches a free-text keyword against script names/descriptions. `bySite` returns every userscript that declares it runs on a specific website, regardless of name/description match.

**What are "libraries"?**
Greasy Fork also hosts reusable JavaScript libraries that other userscripts `@require` - shared code rather than standalone scripts a user installs directly.

**Why is `ratingScore` sometimes slightly different between list and detail modes?**
List pages expose Greasy Fork's own precomputed relevance-adjusted score. Detail mode (which doesn't expose that score directly) derives an equivalent score from the visible good/OK/bad rating counts. Both describe the same underlying ratings.

**Why do some scripts have no `appliesTo`?**
Only `byScriptIds` (detail) mode returns target sites - the list pages this actor uses for `search`/`bySite`/`libraries`/`byAuthor` don't expose that field per row, only on the individual script page.

**Does `sortBy` work with `byAuthor`?**
No - Greasy Fork's user-profile page (`/en/users/{id}`) ignores the `sort` query parameter entirely and always returns that author's scripts in its own fixed default order, unlike `search`/`bySite`/`libraries` (all three genuinely honor `sortBy`). `byAuthor` still returns every script by that author with complete, correct data - only the ordering can't be controlled.

**Is this affiliated with Greasy Fork?**
No - this is an independent, third-party actor built on Greasy Fork's publicly accessible pages.

**Are there rate limits?**
The actor uses polite delays between page loads. `maxItems` above ~200 will take longer since Greasy Fork paginates at 100 results per page.

# Actor input Schema

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

What to fetch.

## `searchQuery` (type: `string`):

Free-text keyword search, e.g. `youtube`, `dark mode`, `ad blocker`.

## `site` (type: `string`):

Domain the userscripts run on, e.g. `youtube.com`, `github.com`, `discord.com`.

## `authorId` (type: `string`):

Greasy Fork numeric author/user ID or full profile URL, e.g. `1` or `https://greasyfork.org/en/users/1-username`.

## `sortBy` (type: `string`):

Ordering for search/bySite/libraries results. Not honored for byAuthor - Greasy Fork's user-profile page ignores the sort parameter and always returns scripts in its own default order.

## `excludeSensitive` (type: `boolean`):

Skip userscripts Greasy Fork flags as sensitive (mature/adult-oriented targets).

## `minTotalInstalls` (type: `integer`):

Drop scripts with fewer lifetime installs than this.

## `scriptIds` (type: `array`):

Greasy Fork numeric script IDs or full script URLs, e.g. `406540` or `https://greasyfork.org/en/scripts/406540-undiscord`.

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

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "youtube",
  "sortBy": "relevance",
  "excludeSensitive": false,
  "scriptIds": [],
  "maxItems": 30
}
```

# Actor output Schema

## `userscripts` (type: `string`):

Dataset containing all scraped Greasy Fork userscripts.

# 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 = {
    "mode": "search",
    "searchQuery": "youtube",
    "sortBy": "relevance",
    "excludeSensitive": false,
    "scriptIds": [],
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/greasy-fork-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 = {
    "mode": "search",
    "searchQuery": "youtube",
    "sortBy": "relevance",
    "excludeSensitive": False,
    "scriptIds": [],
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/greasy-fork-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 '{
  "mode": "search",
  "searchQuery": "youtube",
  "sortBy": "relevance",
  "excludeSensitive": false,
  "scriptIds": [],
  "maxItems": 30
}' |
apify call crawlerbros/greasy-fork-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlerbros/greasy-fork-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/qbAKJmgLOJsx7EI0M/builds/OToqghzYEqqOlDoBf/openapi.json
