# Roblox Game Finder (`caring_scenario/roblox-game-finder`) Actor

Search for Roblox games based on keywords. Results will include the games information including: gameId, keyword, playerCount, thumbnail ,title and url.

- **URL**: https://apify.com/caring\_scenario/roblox-game-finder.md
- **Developed by:** [I G](https://apify.com/caring_scenario) (community)
- **Categories:** Automation, Integrations, Social media
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN 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/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Roblox Game Finder - Apify Actor

An Apify actor that scrapes Roblox games based on user-provided keywords. The actor searches Roblox for games and returns results that match one or more of the provided keywords.

### Features

- **Keyword-based search**: Search for games using one or more keywords
- **Deduplication**: Automatically removes duplicate games based on game ID
- **Pagination support**: Scrapes multiple pages of results
- **Robust extraction**: Uses multiple fallback methods to extract game information
- **Comprehensive data**: Extracts title, URL, game ID, description, thumbnail, and player count

### Input

The actor accepts the following input parameters:

```json
{
  "keywords": ["obby", "simulator"],
  "maxResults": 50,
  "maxPages": 5,
  "searchInDescription": false
}
````

#### Input Schema

- **keywords** (required): Array of strings - Keywords to search for. Games matching one or more keywords will be returned.
- **maxResults** (optional): Integer (1-500) - Maximum number of games to return per keyword. Default: 50
- **maxPages** (optional): Integer (1-20) - Maximum number of pages to scrape per keyword. Default: 5
- **searchInDescription** (optional): Boolean - If `true`, will fetch full game descriptions from detail pages and search for keywords in them. This is slower but more thorough. Default: `false`

### Output

The actor outputs an array of game objects, each containing:

- **title**: Game title
- **url**: Full URL to the game page
- **gameId**: Unique Roblox game ID
- **description**: Game description (short description from search page, or full description if `searchInDescription` is enabled)
- **thumbnail**: Game thumbnail image URL (if available)
- **playerCount**: Current player count (if available)
- **rating**: Like/favorite percentage (if available)
- **keyword**: The keyword that matched this game
- **scrapedAt**: ISO timestamp of when the game was scraped
- **Additional fields from game-stat elements** (if available):
  - **visits**: Total visits count
  - **favorites**: Number of favorites
  - **likes**: Number of likes
  - **genre**: Game genre/category
  - **created**: Creation date
  - **updated**: Last updated date
  - Other stats found in `.game-stat` elements

#### Example Output

```json
[
  {
    "title": "Adopt Me!",
    "url": "https://www.roblox.com/games/920587237",
    "gameId": "920587237",
    "description": "Adopt cute pets and build your dream home!",
    "thumbnail": "https://...",
    "playerCount": "1.2M",
    "rating": "96%",
    "visits": "30.5B",
    "favorites": "45.2M",
    "likes": "12.5M",
    "genre": "Simulation",
    "keyword": "adopt",
    "scrapedAt": "2024-01-15T10:30:00.000Z"
  }
]
```

### How It Works

1. The actor takes keywords as input
2. For each keyword, it navigates to Roblox's game search page
3. It extracts game information from the search results using multiple selector strategies
4. Games are filtered to include only those matching at least one keyword
5. Duplicate games (same game ID) are removed
6. Results are saved to the Apify dataset

### Local Development

**✅ No Apify deployment needed!** The actor works completely locally using the Apify SDK's local mode.

#### Prerequisites

1. Install Node.js 18+ if you haven't already
2. Install dependencies:

```bash
npm install
```

#### Testing Locally (No Deployment Required)

The simplest way to test locally:

##### Method 1: Simple Test Script (Easiest)

Just run:

```bash
npm test
```

This automatically:

- Reads `INPUT.json` for test input
- Runs the actor in local mode (no deployment needed)
- Saves results to `./storage/datasets/default/`
- Works completely offline

##### Method 2: Using Environment Variable

Set the `APIFY_INPUT_PATH` environment variable to point to your input file:

```bash
APIFY_INPUT_PATH=./INPUT.json npm start
```

Or on Windows (PowerShell):

```powershell
$env:APIFY_INPUT_PATH="./INPUT.json"; npm start
```

##### Method 3: Using Apify CLI (Optional)

If you have Apify CLI installed, you can also use:

```bash
npm install -g apify-cli
apify run
```

This is optional - the simple `npm test` works without any CLI tools.

##### Method 4: Direct Input (for quick testing)

You can also pass input directly as an environment variable:

```bash
APIFY_INPUT='{"keywords":["obby"],"maxResults":5,"maxPages":1}' npm start
```

#### Test Input File

A sample `INPUT.json` file is included with test keywords. You can modify it to test with different keywords:

```json
{
  "keywords": ["obby", "simulator"],
  "maxResults": 10,
  "maxPages": 2
}
```

#### Viewing Results

When running locally, results will be:

- **Logged to the console** - You'll see progress and final count
- **Saved to local storage** - Results are in `./storage/datasets/default/` as JSON files

To view the results:

```bash
## After running the test, check the results
cat storage/datasets/default/*.json
```

Or open the JSON files in the `./storage/datasets/default/` directory.

#### Important Notes

- ✅ **No Apify account needed** - Works completely offline
- ✅ **No deployment required** - Test locally before deploying
- ✅ **Local storage** - All data saved to `./storage/` directory
- ✅ **Same code** - The code works the same locally and on Apify platform

### Deployment

To deploy this actor to Apify:

1. Push your code to a Git repository
2. Create a new actor in Apify
3. Connect your Git repository
4. Apify will automatically build and deploy your actor

### Requirements

- Node.js 18+
- Apify SDK v3
- Playwright for browser automation

### Notes

- The actor uses Playwright to handle dynamic content loading
- Multiple fallback selectors are used to handle changes in Roblox's HTML structure
- The actor respects rate limits by using a max concurrency of 2
- Results are automatically deduplicated by game ID

# Actor input Schema

## `keywords` (type: `array`):

Array of keywords to search for. Games matching one or more keywords will be returned.

## `maxResults` (type: `integer`):

Maximum number of games to return per keyword

## `maxPages` (type: `integer`):

Maximum number of pages to scrape per keyword

## `searchInDescription` (type: `boolean`):

If enabled, will fetch full game descriptions from detail pages and search for keywords in them. This is slower but more thorough.

## Actor input object example

```json
{
  "keywords": [],
  "maxResults": 50,
  "maxPages": 5,
  "searchInDescription": false
}
```

# Actor output Schema

## `games` (type: `string`):

List of Roblox games matching the search keywords

# 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("caring_scenario/roblox-game-finder").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("caring_scenario/roblox-game-finder").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 '{}' |
apify call caring_scenario/roblox-game-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=caring_scenario/roblox-game-finder",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Roblox Game Finder",
        "description": "Search for Roblox games based on keywords. Results will include the games information including: gameId, keyword, playerCount, thumbnail ,title and url.",
        "version": "1.0",
        "x-build-id": "eReVpJkUjkjiT2WEI"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/caring_scenario~roblox-game-finder/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-caring_scenario-roblox-game-finder",
                "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/caring_scenario~roblox-game-finder/runs": {
            "post": {
                "operationId": "runs-sync-caring_scenario-roblox-game-finder",
                "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/caring_scenario~roblox-game-finder/run-sync": {
            "post": {
                "operationId": "run-sync-caring_scenario-roblox-game-finder",
                "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": "array",
                        "description": "Array of keywords to search for. Games matching one or more keywords will be returned.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of games to return per keyword",
                        "default": 50
                    },
                    "maxPages": {
                        "title": "Max Pages",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of pages to scrape per keyword",
                        "default": 5
                    },
                    "searchInDescription": {
                        "title": "Search in Description",
                        "type": "boolean",
                        "description": "If enabled, will fetch full game descriptions from detail pages and search for keywords in them. This is slower but more thorough.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
