# LLM Prompt Response (`jakubsuchy/llm-prompt-response`) Actor

Submits prompts to LLM providers (ChatGPT, Perplexity) via Camoufox anti-detect browser and captures structured responses with sources.

- **URL**: https://apify.com/jakubsuchy/llm-prompt-response.md
- **Developed by:** [Jakub Suchy](https://apify.com/jakubsuchy) (community)
- **Categories:** AI, Agents, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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.

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

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

## LLM Prompt Response

Scrape real responses from ChatGPT, Perplexity AI, Google Gemini, and Google AI Mode by submitting prompts through an actual browser. Get the exact same answers a human user would see -- complete with cited sources, links, and full-length responses.

Unlike API-based approaches, this Actor uses **Camoufox** (anti-detect Firefox) with human-like behavior to interact with LLM chat interfaces directly. This means you get responses identical to what users see in the browser, including web search results, citations, and source links that are not available through official APIs.

### What can you use it for?

- **Brand monitoring** -- Track how AI chatbots mention your brand vs. competitors in organic responses
- **SEO & AI visibility research** -- Discover which websites ChatGPT and Perplexity cite as sources
- **Competitor analysis** -- See which brands get recommended for specific queries
- **LLM output benchmarking** -- Compare how different AI providers answer the same questions
- **Content gap analysis** -- Find out what AI recommends and identify content opportunities
- **Market research** -- Understand how AI perceives products, services, and industries
- **Citation tracking** -- Monitor which URLs appear in AI-generated answers over time

### Supported providers

| Provider | Auth required | Sources | Notes |
|----------|--------------|---------|-------|
| **Perplexity** | No | Yes | Default. No login needed, great for quick research queries |
| **ChatGPT** | Yes | Yes | Requires email + password. Optional TOTP for 2FA accounts |
| **Google Gemini** | No | Yes | No login needed |
| **Google AI Mode** | No | Yes | No login needed. Sources extracted from response text |

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `prompts` | `string[]` | Yes | -- | One or more prompts to send. Each prompt produces one dataset item. |
| `provider` | `string` | No | `perplexity` | Which LLM provider to use: `chatgpt`, `perplexity`, `gemini`, or `google-aimode` |

#### Example input

```json
{
    "prompts": [
        "What are the best project management tools for remote teams?"
    ],
    "provider": "perplexity"
}
````

#### Google AI Mode example

```json
{
    "prompts": [
        "What are the best project management tools for remote teams?"
    ],
    "provider": "google-aimode"
}
```

### Output

Each prompt produces one item in the dataset with the following structure:

```json
{
    "question": "What are the best project management tools for remote teams?",
    "answer": "The top project management tools for remote teams include Notion, Linear, Asana, and Jira. Notion is popular for its flexibility combining docs, wikis, and task tracking in one place. Linear is favored by engineering teams for its speed and clean interface. Asana works well for cross-functional teams managing complex workflows, while Jira remains the standard for software development projects with deep issue tracking and sprint planning features.",
    "sources": [
        {
            "href": "https://www.atlassian.com/software/jira",
            "title": "Jira | Issue & Project Tracking Software | Atlassian"
        },
        {
            "href": "https://asana.com",
            "title": "Asana · Manage your team's work, projects, & tasks online"
        },
        {
            "href": "https://linear.app",
            "title": "Linear – The new standard for modern software development"
        }
    ],
    "provider": "perplexity",
    "url": "https://www.perplexity.ai/search/what-are-the-best-project-mana...",
    "timestamp": "2026-04-01T12:00:00.000Z"
}
```

#### Output fields

| Field | Type | Description |
|-------|------|-------------|
| `question` | `string` | The original prompt that was submitted |
| `answer` | `string` | The full text response from the LLM provider |
| `sources` | `array` | List of cited sources with `href` (URL) and `title` |
| `provider` | `string` | Which provider generated this response (`chatgpt`, `perplexity`, `gemini`, or `google-aimode`) |
| `url` | `string` | The browser URL of the conversation page |
| `timestamp` | `string` | ISO 8601 timestamp of when the response was captured |

If a prompt fails, the dataset item will include `"answer": null` and an `"error"` field with the failure reason. Successful prompts are not affected by individual failures.

### How it works

1. Launches **Camoufox** -- a modified Firefox build with anti-fingerprinting and human-like mouse movements, typing delays, and scroll behavior
2. Navigates to the selected provider (ChatGPT, Perplexity, Google Gemini, or Google AI Mode)
3. Handles authentication if needed
4. Automatically dismisses cookie banners, popups, and Cloudflare challenges
5. Submits each prompt, waits for the full streamed response to complete
6. Extracts the response text and cited source URLs
7. Pushes each result to the Apify Dataset

All requests are routed through **US residential proxies** for maximum reliability and anti-detection.

### Performance & resources

- Each prompt takes approximately **30 seconds to 3 minutes** depending on the provider and response length
- Prompts are processed **sequentially** (browser automation is single-threaded)
- Recommended memory: **4 GB** minimum
- No browser profile is persisted between runs -- each run starts with a clean session

### API usage

#### Synchronous (wait for results inline)

Best for short prompt lists (under 5 minutes total runtime):

```bash
curl -X POST "https://api.apify.com/v2/acts/jakubsuchy~llm-prompt-response/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompts": ["What are the best enterprise project management systems??"],
    "provider": "perplexity"
  }'
```

Returns dataset items directly in the response body.

#### Asynchronous (start run, poll, fetch)

Best for larger batches or when you need non-blocking behavior:

```bash
## 1. Start the run
curl -X POST "https://api.apify.com/v2/acts/jakubsuchy~llm-prompt-response/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompts": ["What are the best enterprise project management systems??"],
    "provider": "perplexity"
  }'
## Response contains: { "data": { "id": "RUN_ID", "status": "RUNNING", ... } }

## 2. Poll until status is SUCCEEDED (or FAILED / TIMED-OUT)
curl "https://api.apify.com/v2/acts/jakubsuchy~llm-prompt-response/runs/RUN_ID?token=YOUR_APIFY_TOKEN"

## 3. Fetch results
curl "https://api.apify.com/v2/acts/jakubsuchy~llm-prompt-response/runs/RUN_ID/dataset/items?token=YOUR_APIFY_TOKEN"
```

Bash polling loop:

```bash
RUN_ID="your-run-id"
TOKEN="your-token"

while true; do
  STATUS=$(curl -s "https://api.apify.com/v2/acts/jakubsuchy~llm-prompt-response/runs/$RUN_ID?token=$TOKEN" \
    | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['status'])")
  echo "Status: $STATUS"
  [[ "$STATUS" == "SUCCEEDED" || "$STATUS" == "FAILED" || "$STATUS" == "TIMED-OUT" ]] && break
  sleep 5
done

curl -s "https://api.apify.com/v2/acts/jakubsuchy~llm-prompt-response/runs/$RUN_ID/dataset/items?token=$TOKEN"
```

### Integrations

Connect LLM Prompt Response with other tools using Apify's built-in integrations:

- **Webhooks** -- Get notified when a run completes
- **API** -- Trigger runs programmatically and fetch results via the Apify API
- **Schedules** -- Run on a recurring schedule to track AI responses over time
- **Google Sheets** -- Export results directly to a spreadsheet
- **Slack / Email** -- Send notifications when runs finish

# Actor input Schema

## `prompts` (type: `array`):

One or more prompts to send to the LLM provider. Each prompt produces one dataset item.

## `provider` (type: `string`):

Which LLM provider to query.

## `chatgptEmail` (type: `string`):

Email address for ChatGPT login. Required when provider is 'chatgpt'.

## `chatgptPassword` (type: `string`):

Password for ChatGPT login. Required when provider is 'chatgpt'.

## `chatgptTotpSecret` (type: `string`):

Base32 TOTP secret or otpauth:// URI for ChatGPT two-factor authentication. Optional.

## `claudeEmail` (type: `string`):

Email address for Claude login. Required when provider is 'claude'.

## `claudePassword` (type: `string`):

Password for Claude login. Required when provider is 'claude'.

## `screenshots` (type: `boolean`):

Capture a screenshot every 5 seconds during the run. Saved to Key-Value Store for debugging.

## Actor input object example

```json
{
  "prompts": [
    "What are the best project management tools for remote teams?"
  ],
  "provider": "perplexity",
  "screenshots": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "prompts": [
        "What are the best project management tools for remote teams?"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jakubsuchy/llm-prompt-response").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 = { "prompts": ["What are the best project management tools for remote teams?"] }

# Run the Actor and wait for it to finish
run = client.actor("jakubsuchy/llm-prompt-response").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 '{
  "prompts": [
    "What are the best project management tools for remote teams?"
  ]
}' |
apify call jakubsuchy/llm-prompt-response --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jakubsuchy/llm-prompt-response",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "LLM Prompt Response",
        "description": "Submits prompts to LLM providers (ChatGPT, Perplexity) via Camoufox anti-detect browser and captures structured responses with sources.",
        "version": "0.0",
        "x-build-id": "YDV2xyaYq6bsdAIqX"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/jakubsuchy~llm-prompt-response/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-jakubsuchy-llm-prompt-response",
                "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/jakubsuchy~llm-prompt-response/runs": {
            "post": {
                "operationId": "runs-sync-jakubsuchy-llm-prompt-response",
                "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/jakubsuchy~llm-prompt-response/run-sync": {
            "post": {
                "operationId": "run-sync-jakubsuchy-llm-prompt-response",
                "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": [
                    "prompts"
                ],
                "properties": {
                    "prompts": {
                        "title": "Prompts",
                        "type": "array",
                        "description": "One or more prompts to send to the LLM provider. Each prompt produces one dataset item.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "provider": {
                        "title": "Provider",
                        "enum": [
                            "chatgpt",
                            "perplexity",
                            "gemini",
                            "claude",
                            "google-aimode"
                        ],
                        "type": "string",
                        "description": "Which LLM provider to query.",
                        "default": "perplexity"
                    },
                    "chatgptEmail": {
                        "title": "ChatGPT Email",
                        "type": "string",
                        "description": "Email address for ChatGPT login. Required when provider is 'chatgpt'."
                    },
                    "chatgptPassword": {
                        "title": "ChatGPT Password",
                        "type": "string",
                        "description": "Password for ChatGPT login. Required when provider is 'chatgpt'."
                    },
                    "chatgptTotpSecret": {
                        "title": "ChatGPT TOTP Secret",
                        "type": "string",
                        "description": "Base32 TOTP secret or otpauth:// URI for ChatGPT two-factor authentication. Optional."
                    },
                    "claudeEmail": {
                        "title": "Claude Email",
                        "type": "string",
                        "description": "Email address for Claude login. Required when provider is 'claude'."
                    },
                    "claudePassword": {
                        "title": "Claude Password",
                        "type": "string",
                        "description": "Password for Claude login. Required when provider is 'claude'."
                    },
                    "screenshots": {
                        "title": "Screenshots",
                        "type": "boolean",
                        "description": "Capture a screenshot every 5 seconds during the run. Saved to Key-Value Store for debugging.",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
