# Quora Question, Profile & Stats Scraper (`zealous_judge/quora-scraper`) Actor

Scrapes Quora questions, answers, user profiles, and personal stats. Supports keyword search, question edit logs, profile data, and content statistics.

- **URL**: https://apify.com/zealous\_judge/quora-scraper.md
- **Developed by:** [Dav Bhagalpur](https://apify.com/zealous_judge) (community)
- **Categories:** Social media, AI, Developer tools
- **Stats:** 1 total users, 1 monthly users, 21.4% runs succeeded, 0 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 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

## Quora Scraper (Apify Actor)

A robust, stealthy Apify Actor for scraping Quora questions, answers, user profiles, and statistics. It uses `undetected-chromedriver` and seamlessly supports Apify Residential Proxies for maximum bypass success.

### 🚀 Features

- **Question Search & Extraction**: Input keywords and scrape questions along with all their answers using Quora's advanced search.
- **Direct Question Logs**: Extract detailed history (answers, authors, timestamps) from specific Question URLs.
- **Profile Scraping**: Extract public profile information, bio, followers, and credentials.
- **User Stats**: Extract total views, upvotes, shares, and content count.
- **Authentication**: Easy cookie injection via Actor Input (`m-b` and `m-s`).
- **Stealth**: Built-in support for proxy authentication, Manifest V3 stealth extensions, and headless undetected-chromedriver on Linux.

***

### 🛠️ How to Use (Apify Cloud)

1. Add this Actor to your Apify account.

2. In the **Input** tab, configure your run:
   - **Task**: Select `query`, `scrape_question`, `scrape_profile`, or `scrape_stats`.
   - **Cookies**: Provide valid `m-b` and `m-s` cookies from an active Quora session to access data securely.
   - **Keywords / URLs**: Provide search terms or direct Quora URLs depending on the task.
   - **Proxy**: We highly recommend enabling **Residential Proxies** for best results to avoid Quora's IP bans.

3. Click **Start**. The Actor will output the extracted data into the Apify Default Dataset in JSON format.

#### Input Schema Definition

Here is an example of the JSON input you can provide:

```json
{
  "task": "query",
  "keywords": ["machine learning"],
  "type": "question",
  "time": "week",
  "max": 10,
  "headless": true,
  "cookies": {
    "m-b": "YOUR_M_B_COOKIE_HERE",
    "m-s": "YOUR_M_S_COOKIE_HERE"
  }
}
```

***

### 💻 Local Development

#### 1. Prerequisites

- Python 3.11+
- [Apify CLI](https://docs.apify.com/cli) installed (`npm install -g apify-cli`)
- Google Chrome installed on your system

#### 2. Run Locally

Create a `.actor/` directory (if it doesn't exist) and ensure `INPUT.json` is set up in `storage/key_value_stores/default/INPUT.json`.

Then, run the actor locally via the Apify CLI:

```bash
apify run
```

#### 3. Deploy to Apify

Once you've made your changes, push the updated code to the Apify Cloud:

```bash
apify push
```

***

### ⚙️ Architecture

This project was migrated from a FastAPI/Uvicorn server to an Apify Actor.

- **`src/main.py`**: The main entry point that receives Apify Input and routes to the correct scraper task.
- **`hybrid_parser.py` & `profile_scraper.py`**: The core scraping engines powered by Selenium and `undetected-chromedriver`.
- **`Dockerfile`**: Custom Python 3.11 image containing Google Chrome and Xvfb for Linux headless rendering.

# Actor input Schema

## `task` (type: `string`):

Which scraping task to run. Each maps to an original API endpoint.

## `query` (type: `array`):

List of search terms to query on Quora. Required for 'query' task. E.g. \['lpu', 'iit delhi']

## `urls` (type: `array`):

List of Quora URLs. Used for 'scrape\_question' (question URL), 'scrape\_profile' (profile URL), and 'scrape\_stats' (use https://www.quora.com/stats).

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

Filter results by content type. Only used for 'query' task.

## `time` (type: `string`):

Filter results by time range. Only used for 'query' task.

## `maxQuestions` (type: `integer`):

Maximum number of questions to scrape. Only used for 'query' task.

## `cookies` (type: `object`):

Your Quora session cookies (m-b and m-s). MANDATORY for scrape\_stats. Recommended for all other tasks to avoid login walls. Extract from browser DevTools → Application → Cookies → quora.com.

## `useResidentialProxy` (type: `boolean`):

Routes traffic through residential IPs to bypass Quora's anti-bot system. Strongly recommended for cloud runs. Disable only for local testing.

## Actor input object example

```json
{
  "task": "query",
  "type": "question",
  "time": "week",
  "maxQuestions": 50,
  "cookies": {
    "m-b": "YOUR_M_B_COOKIE_VALUE",
    "m-s": "YOUR_M_S_COOKIE_VALUE"
  },
  "useResidentialProxy": 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 = {
    "cookies": {
        "m-b": "YOUR_M_B_COOKIE_VALUE",
        "m-s": "YOUR_M_S_COOKIE_VALUE"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zealous_judge/quora-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 = { "cookies": {
        "m-b": "YOUR_M_B_COOKIE_VALUE",
        "m-s": "YOUR_M_S_COOKIE_VALUE",
    } }

# Run the Actor and wait for it to finish
run = client.actor("zealous_judge/quora-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 '{
  "cookies": {
    "m-b": "YOUR_M_B_COOKIE_VALUE",
    "m-s": "YOUR_M_S_COOKIE_VALUE"
  }
}' |
apify call zealous_judge/quora-scraper --silent --output-dataset

```

## MCP server setup

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